use send-mail service to mail.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- user-client/maintain/walk-os-test/walk-os-iperf-test | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/user-client/maintain/walk-os-test/walk-os-iperf-test b/user-client/maintain/walk-os-test/walk-os-iperf-test index 7ed07c5..f65959d 100755 --- a/user-client/maintain/walk-os-test/walk-os-iperf-test +++ b/user-client/maintain/walk-os-test/walk-os-iperf-test @@ -34,6 +34,16 @@ OS_MOUNT = %w[cifs initramfs].freeze
EMAIL_ADDRESS = (ENV['USER']).to_s.freeze
+def send_mail + message = File.read(LOG).chomp + data = " + subject: os rootfs test report + to: #{EMAIL_ADDRESS} + body: '#{message}'" + + %x(curl -X POST 'localhost:11311/send_mail_yaml' -d "#{data}") +end + def write_report(report_all) file = File.open(LOG, 'a') log = Logger.new(file, 'weekly')