+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
good
Thanks, Yinsi
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