More Debian HVM testcases
PATCH 1/1 More Debian HVM testcases
ts-debain-hvm-install was written to work as general HVM testcase. It can be tuned to easily use another BIOS other than OVMF.
Modify make-flight and friends to create more Debian HVM 64bit testcases to run with SeaBIOS and ROMBIOS.
--- make-flight | 31 ++++++++++++++++++++++++------- sg-run-job | 8 +++++++- ts-debian-hvm-install | 10 ++++++++-- 3 files changed, 39 insertions(+), 10 deletions(-)
make-flight +24 -7
@@ -162,15 +162,32 @@ do_hvm_win7_x64_tests () { all_hostflags=$most_hostflags,hvm } -do_hvm_debian_ovmf_tests() { - if [ $xenarch != amd64 -o "x$qemuu_suffix" != "x-qemuu" ]; then +do_hvm_debian_tests() { + if [ $xenarch != amd64 ]; then return fi - job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-ovmf-amd64 \ - test-debianhvm xl $xenarch $dom0arch $qemuu_runvar \ - ovmf_image=debian-7.2.0-amd64-CD-1.iso \ - all_hostflags=$most_hostflags,hvm + if [ "x$qemuu_suffix" == "x-qemuu" ]; then + # QEMU upstream supports ovmf and seabios + job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-ovmf-amd64 \ + test-debianhvm-ovmf xl $xenarch $dom0arch $qemuu_runvar \ + ovmf_image=debian-7.2.0-amd64-CD-1.iso \ + bios=ovmf \ + all_hostflags=$most_hostflags,hvm + + job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-debianhvm-amd64 \ + test-debianhvm xl $xenarch $dom0arch $qemuu_runvar \ + debianhvm_image=debian-7.2.0-amd64-CD-1.iso \ + bios=seabios \ + all_hostflags=$most_hostflags,hvm + else + # QEMU traditional supports rombios + job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-debianhvm-amd64 \ + test-debianhvm xl $xenarch $dom0arch $qemuu_runvar \ + debianhvm_image=debian-7.2.0-amd64-CD-1.iso \ + bios=rombios \ + all_hostflags=$most_hostflags,hvm + fi } do_hvm_rhel6_tests () {
@@ -285,7 +302,7 @@ test_matrix_do_one () { do_hvm_win7_x64_tests do_hvm_rhel6_tests - do_hvm_debian_ovmf_tests + do_hvm_debian_tests done # qemuu_suffix
sg-run-job +7 -1
@@ -265,10 +265,16 @@ proc run-job/test-rhelhvm {} { test-guest-nomigr redhat } +proc need-hosts/test-debianhvm-ovmf {} { return host } +proc run-job/test-debianhvm-ovmf {} { + run-ts . = ts-debian-hvm-install + test-guest ovmf +} + proc need-hosts/test-debianhvm {} { return host } proc run-job/test-debianhvm {} { run-ts . = ts-debian-hvm-install - test-guest ovmf + test-guest debianhvm } proc need-hosts/test-pair {} { return {src_host dst_host} }
ts-debian-hvm-install +8 -2
@@ -28,7 +28,13 @@ if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; } our ($whhost,$gn) = @ARGV; $whhost ||= 'host'; -$gn ||= 'ovmf'; +defined($r{bios}) or die "Need to define which bios to use"; +if ($r{bios} =~ /ovmf/m) { + $gn ||= 'ovmf'; +} else { + # rombios or seabios + $gn ||= 'debianhvm'; +} our $ho= selecthost($whhost);
@@ -152,7 +158,7 @@ sub prep () { more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, OnReboot => 'preserve', - Bios => 'ovmf', + Bios => $r{bios}, PostImageHook => sub { my $cmds = iso_copy_content_from_image($gho, $newiso); $cmds .= prepare_initrd($initrddir,$newiso,$preseed_file_path);
Signature · 1 line
1.7.10.4
Quoted 6 lines · Wei Liu
ts-debian-hvm-install +0
-0@@ -28,7 +28,13 @@ if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; }
ts-debian-hvm-install if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; } · line 37
Quoted 10 lines
ts-debian-hvm-install +7
-1our ($whhost,$gn) = @ARGV; $whhost ||= 'host'; -$gn ||= 'ovmf'; +defined($r{bios}) or die "Need to define which bios to use"; +if ($r{bios} =~ /ovmf/m) { + $gn ||= 'ovmf'; +} else { + # rombios or seabios + $gn ||= 'debianhvm'; +}
Does the the guest name matter all that much? Can't it just be debianhvm regardless of the BIOS type? That would simplify this and sg-run-jobs wouldn't it?
In any case I'd think that sg-run-jobs ought to supply the name by default, i.e.
proc need-hosts/test-debianhvm-ovmf {} { return host } proc run-job/test-debianhvm-ovmf {} {
run-ts . = ts-debian-hvm-install ovmf test-guest ovmf
}
proc need-hosts/test-debianhvm {} { return host }
proc run-job/test-debianhvm {} {
run-ts . = ts-debian-hvm-install debianhvm
test-guest debianhvm
}
(and presumably this could then be refactored into a common function with name parameter)
Quoted 7 lines · Ian Campbell
Quoted 6 lines · Wei Liu
ts-debian-hvm-install +0
-0@@ -28,7 +28,13 @@ if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; }
Quoted 15 lines
ts-debian-hvm-install if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; } · line 37
Quoted 10 lines
ts-debian-hvm-install +7
-1our ($whhost,$gn) = @ARGV; $whhost ||= 'host'; -$gn ||= 'ovmf'; +defined($r{bios}) or die "Need to define which bios to use"; +if ($r{bios} =~ /ovmf/m) { + $gn ||= 'ovmf'; +} else { + # rombios or seabios + $gn ||= 'debianhvm'; +}Does the the guest name matter all that much? Can't it just be debianhvm regardless of the BIOS type? That would simplify this and sg-run-jobs wouldn't it?
Yes this can be done. What really matters is the bios parameter passed in.
Quoted 9 lines
In any case I'd think that sg-run-jobs ought to supply the name by default, i.e.
proc need-hosts/test-debianhvm-ovmf {} { return host } proc run-job/test-debianhvm-ovmf {} {
run-ts . = ts-debian-hvm-install ovmf test-guest ovmf
}
Quoted 10 lines
proc need-hosts/test-debianhvm {} { return host }
proc run-job/test-debianhvm {} {
run-ts . = ts-debian-hvm-install debianhvm
test-guest debianhvm
}(and presumably this could then be refactored into a common function with name parameter)
I think this can be done. Time to learn some TCL...
Wei.