+require "#{ENV['CCI_SRC']}/lib/es_query" +require "#{ENV['LKP_SRC']}/lib/monitor" +require 'time' +require 'logger' +require 'rufus-scheduler'
+TEST_OS = ['openeuler aarch64 20.03',
'centos aarch64 7.6.1810',
'centos aarch64 7.8.2003',
'centos aarch64 8.1.1911',
'debian aarch64 sid',
'archlinux aarch64 2020-11-12'].freeze
+TEST_YAML = 'iperf-walk-os.yaml'
+TESTBOX = 'vm-2p8g'
+LOG = 'walk-test.report'
+OS_MOUNT = %w[cifs initramfs].freeze
+EMAIL_ADDRESS = (ENV['USER']).to_s.freeze
+def run_qemu
- Process.fork do
- %x(#{ENV['CCI_SRC']}/providers/my-qemu.sh >/dev/null 2>&1)
- end
+end
+def submit_job(os_str, os_mount)
- `submit 'os os_arch os_version=#{os_str}' testbox=#{TESTBOX}' 'queue=#{TESTBOX}~#{ENV['USER']}' \
use my-submit can remove queue=xxx~USER
Thanks, Shenwei
'os_mount=#{os_mount}' #{TEST_YAML}`
+end
+def traversal_os_mount
- OS_MOUNT.each do |os_mount|
- p os_mount
- traversal_test_os(os_mount)
- end
+end
+def traversal_test_os(os_mount)
- TEST_OS.each do |os_str|
- test_rootfs(os_str, os_mount)
- end
+end
+def test_rootfs(os_str, os_mount)
- message = submit_job(os_str, os_mount).chomp
- puts message
- job_id = message.split('=')[1]
- run_qemu
- job_result = if message.include? 'error'
[]
else
find_by_id(job_id)
end
- report_all = job_id.split(', ') + os_args + job_result
- write_report(report_all)
+end
+def cron_job
- test = Rufus::Scheduler.new
- test.cron '0 8-22 * * *' do
- traversal_os_mount
- end
- mail = Rufus::Scheduler.new
- mail.cron '0 8 * * 1' do
- send_mail
- end
- [test, mail].each do |job|
- job.join
- end
+end
+cron_job
2.23.0