* [OSSTEST PATCH 0/4] Introduction of the patches.
@ 2014-11-28 7:45 longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 1/4] Add nested testcase of preparing and installing L1 guest longtao.pang
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: longtao.pang @ 2014-11-28 7:45 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, robert.hu, longtaox.pang,
di.zheng
We updated these patchs about adding Nested test job into OSSTest.
Nested virtualization is the function of running a hypervisor inside a virtual machine.
The hypervisor that runs on the real hardware is called a level 0 or L0;
The hypervisor that runs as a guest inside L0 is called level 1 or L1;
A guest that running inside the L1 hypervisor is called a level 2 or L2.
For running nested test job, we should run build-amd64 job and build-amd64-hvm job first.
During the testing, it will install L1 guest VM inside L0,
the L1 guest should build xen and HVM Dom0 kernel and then boot into xen kernel.
Next, begin to install L2 guest VM inside L1.
After that, make sure ping L2 is successfully
----------------------------------------------------------------
root (4):
Add nested testcase of preparing and installing L1 guest
Building XEN and HVM Dom0 kernel for L1 guest VM
Add nested test case of installing L2 guest VM
Insert nested test job name and runvars into standalone database
Osstest/Debian.pm | 25 ++-
Osstest/TestSupport.pm | 31 +++-
make-flight | 19 ++
mfi-common | 8 +
sg-run-job | 8 +
ts-debian-install | 166 +++++++++++++----
ts-nested-L1-debian-install-part1 | 202 ++++++++++++++++++++
ts-nested-L1-debian-install-part2 | 364 +++++++++++++++++++++++++++++++++++++
8 files changed, 773 insertions(+), 50 deletions(-)
create mode 100755 ts-nested-L1-debian-install-part1
create mode 100755 ts-nested-L1-debian-install-part2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [OSSTEST PATCH 1/4] Add nested testcase of preparing and installing L1 guest
2014-11-28 7:45 [OSSTEST PATCH 0/4] Introduction of the patches longtao.pang
@ 2014-11-28 7:45 ` longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 2/4] Building XEN and HVM Dom0 kernel for L1 guest VM longtao.pang
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: longtao.pang @ 2014-11-28 7:45 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, robert.hu, longtaox.pang,
di.zheng
From: "longtao.pang" <longtaox.pang@intel.com>
This patch is used for preparing and installing L1 guest VM inside L0 system
on testhost machine.
---
Osstest/Debian.pm | 25 +++--
Osstest/TestSupport.pm | 31 +++++-
sg-run-job | 5 +
ts-nested-L1-debian-install-part1 | 202 +++++++++++++++++++++++++++++++++++++
4 files changed, 249 insertions(+), 14 deletions(-)
create mode 100755 ts-nested-L1-debian-install-part1
diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 8f80eb4..68da2cb 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1,5 +1,6 @@
# This is part of "osstest", an automated testing framework for Xen.
# Copyright (C) 2009-2013 Citrix Inc.
+# Copyright (C) 2014 Intel Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -286,15 +287,18 @@ sub setupboot_grub2 ($$$) {
my $count= 0;
my $entry;
+ my $submenu;
while (<$f>) {
next if m/^\s*\#/ || !m/\S/;
if (m/^\s*\}\s*$/) {
- die unless $entry;
+ die unless $entry || $submenu;
+ if(!defined $entry && defined $submenu){
+ logm("Met end of a submenu starting from $submenu->{StartLine}.Our want kern is $want_kernver");
+ $submenu=undef;
+ next;
+ }
my (@missing) =
- grep { !defined $entry->{$_} }
- (defined $xenhopt
- ? qw(Title Hv KernDom0 KernVer)
- : qw(Title Hv KernOnly KernVer));
+ grep { !defined $entry->{$_} } (defined $xenhopt ? qw(Title Hv KernDom0 KernVer) : qw(Title Hv KernOnly KernVer));
if (@missing) {
logm("(skipping entry at $entry->{StartLine};".
" no @missing)");
@@ -317,21 +321,24 @@ sub setupboot_grub2 ($$$) {
$entry= { Title => $1, StartLine => $., Number => $count };
$count++;
}
- if (m/^\s*multiboot\s*\/(xen\-[0-9][-+.0-9a-z]*\S+)/) {
+ if(m/^submenu\s+[\'\"](.*)[\'\"].*\{\s*$/){
+ $submenu={ StartLine =>$.};
+ }
+ if (m/^\s*multiboot\s*(?:\/boot)*\/(xen\-[0-9][-+.0-9a-z]*\S+)/) {
die unless $entry;
$entry->{Hv}= $1;
}
- if (m/^\s*multiboot\s*\/(vmlinu[xz]-(\S+))/) {
+ if (m/^\s*multiboot\s*(?:\/boot)*\/(vmlinu[xz]-(\S+))/) {
die unless $entry;
$entry->{KernOnly}= $1;
$entry->{KernVer}= $2;
}
- if (m/^\s*module\s*\/(vmlinu[xz]-(\S+))/) {
+ if (m/^\s*module\s*(?:\/boot)*\/(vmlinu[xz]-(\S+))/) {
die unless $entry;
$entry->{KernDom0}= $1;
$entry->{KernVer}= $2;
}
- if (m/^\s*module\s*\/(initrd\S+)/) {
+ if (m/^\s*module\s*(?:\/boot)*\/(initrd\S+)/) {
$entry->{Initrd}= $1;
}
}
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 45ceee9..21955b8 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -55,8 +55,9 @@ BEGIN {
target_putfilecontents_stash
target_putfilecontents_root_stash
target_put_guest_image target_editfile
- target_editfile_root target_file_exists
- target_run_apt
+ target_editfile_root target_file_exists
+ target_file_exists_root
+ target_run_apt
target_install_packages target_install_packages_norec
target_jobdir target_extract_jobdistpath_subdir
target_extract_jobdistpath target_guest_lv_name
@@ -67,7 +68,7 @@ BEGIN {
selecthost get_hostflags get_host_property
get_host_native_linux_console
power_state power_cycle power_cycle_time
- serial_fetch_logs
+ serial_fetch_logs select_ether
propname_massage
get_stashed open_unique_stashfile compress_stashed
@@ -109,6 +110,7 @@ BEGIN {
iso_gen_flags_basic
iso_copy_content_from_image
guest_editconfig_nocd
+ guest_editconfig_cd
);
%EXPORT_TAGS = ( );
@@ -481,6 +483,14 @@ sub target_file_exists ($$) {
die "$rfile $out ?";
}
+sub target_file_exists_root ($$) {
+ my ($ho,$rfile) = @_;
+ my $out= target_cmd_output_root($ho, "if test -e $rfile; then echo y; fi");
+ return 1 if $out =~ m/^y$/;
+ return 0 if $out !~ m/\S/;
+ die "$rfile $out ?";
+}
+
sub teditfileex {
my $user= shift @_;
my $code= pop @_;
@@ -716,6 +726,7 @@ sub power_cycle_time ($) {
sub power_cycle ($) {
my ($ho) = @_;
$mjobdb->host_check_allocated($ho);
+ $mjobdb->xen_check_installed($ho);
die "refusing to set power state for host $ho->{Name}".
" possibly shared with other jobs\n"
if $ho->{SharedMaybeOthers};
@@ -921,7 +932,7 @@ sub compress_stashed($) {
sub host_reboot ($) {
my ($ho) = @_;
target_reboot($ho);
- poll_loop(40,2, 'reboot-confirm-booted', sub {
+ poll_loop(200,2, 'reboot-confirm-booted', sub {
my $output;
if (!eval {
$output= target_cmd_output($ho, <<END, 40);
@@ -1449,7 +1460,7 @@ sub prepareguest_part_xencfg ($$$$$) {
my $xencfg= <<END;
name = '$gho->{Name}'
memory = ${ram_mb}
-vif = [ 'type=ioemu,mac=$gho->{Ether}' ]
+vif = [ 'type=ioemu,model=e1000,mac=$gho->{Ether}' ]
#
on_poweroff = 'destroy'
on_reboot = '$onreboot'
@@ -2047,4 +2058,14 @@ sub guest_editconfig_nocd ($$) {
});
}
+sub guest_editconfig_cd ($) {
+ my ($gho) = @_;
+ guest_editconfig($gho->{Host}, $gho, sub {
+ if (m/^\s*boot\s*= '\s*d\s*c\s*'/) {
+ s/dc/cd/;
+ }
+ s/^on_reboot.*/on_reboot='restart'/;
+ });
+}
+
1;
diff --git a/sg-run-job b/sg-run-job
index 2cf810a..cd8b468 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -288,6 +288,11 @@ proc run-job/test-pair {} {
# run-ts . remus-failover ts-remus-check src_host dst_host + debian
}
+proc need-hosts/test-nested {} {return host}
+proc run-job/test-nested {} {
+ run-ts . = ts-nested-L1-debian-install-part1
+}
+
proc test-guest-migr {g} {
if {[catch { run-ts . = ts-migrate-support-check + host $g }]} return
diff --git a/ts-nested-L1-debian-install-part1 b/ts-nested-L1-debian-install-part1
new file mode 100755
index 0000000..9649b76
--- /dev/null
+++ b/ts-nested-L1-debian-install-part1
@@ -0,0 +1,202 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+# Copyright (C) 2014 Intel Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use Osstest;
+use Osstest::Debian;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our $stage=0;
+if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; }
+
+defined($r{bios}) or die "Need to define which bios to use";
+
+our ($whhost,$gn) = @ARGV;
+$whhost ||= 'host';
+$gn ||= 'nested';
+
+our $ho= selecthost($whhost);
+
+# guest memory size will be set based on host free memory, see below
+our $ram_mb;
+our $disk_mb= 100000;
+
+our $guesthost= "$gn.l1.osstest";
+our $gho;
+
+our $toolstack= toolstack()->{Command};
+
+
+sub preseed () {
+
+ my $preseed_file = preseed_base('wheezy','',());
+ my $authkeys = join('\\n', split(/\n/, authorized_keys()));
+
+ $preseed_file .= (<<END);
+d-i netcfg/get_hostname string $gn
+
+d-i partman-auto/disk string /dev/xvda
+d-i partman-auto/method string regular
+
+d-i partman-auto/expert_recipe string \\
+ boot-root :: \\
+ 512 50 512 vfat \\
+ \$primary{ } \$bootable{ } \\
+ method{ efi } format{ } \\
+ use_filesystem{ } filesystem{ vfat } \\
+ mountpoint{ /boot/efi } \\
+ . \\
+ 95000 50 95000 ext4 \\
+ method{ format } format{ } \\
+ use_filesystem{ } filesystem{ ext4 } \\
+ mountpoint{ / } \\
+ . \\
+ 512 30 100% linux-swap \\
+ method{ swap } format{ } \\
+ .
+
+d-i apt-setup/cdrom/set-first boolean false
+
+d-i preseed/late_command string \\
+ in-target mkdir -p /boot/efi/EFI/boot; \\
+ in-target cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi ;\\
+ in-target mkdir -p /root/.ssh; \\
+ in-target sh -c "echo -e '$authkeys'> /root/.ssh/authorized_keys";
+END
+ return $preseed_file;
+}
+
+sub grub_cfg () {
+
+ return <<"END";
+set default="0"
+set timeout=5
+
+menuentry 'debian guest auto Install' {
+ linux /install.amd/vmlinuz console=vga console=ttyS0,115200n8 preseed/file=/preseed.cfg
+ initrd /install.amd/initrd.gz
+}
+END
+}
+
+sub isolinux_cfg () {
+ return <<"END";
+ default autoinstall
+ prompt 0
+ timeout 0
+
+ label autoinstall
+ kernel /install.amd/vmlinuz
+ append video=vesa:ywrap,mtrr vga=788 console=ttyS0,115200n8 preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz
+END
+}
+
+sub prepare_initrd ($$$) {
+ my ($initrddir,$newiso,$preseed_file_path) = @_;
+ return <<"END";
+ rm -rf $initrddir
+ mkdir $initrddir
+ cd $initrddir
+ gzip -d < $newiso/install.amd/initrd.gz | cpio --extract --make-directories --no-absolute-filename
+ cp $preseed_file_path preseed.cfg
+ find . | cpio -H newc --create | gzip -9 > $newiso/install.amd/initrd.gz
+ cd -
+ rm -rf $initrddir
+ cd $newiso
+ md5sum `find -L -type f -print0 | xargs -0` > md5sum.txt
+ cd -
+END
+}
+
+our $emptyiso= "/root/$flight.$job.$gn-empty.iso";
+
+sub prep () {
+ target_install_packages_norec($ho, qw(lvm2 rsync genisoimage ethtool));
+
+ my $isotimeout= 600;
+
+ $gho= prepareguest($ho, $gn, $guesthost, 22,
+ $disk_mb + 1,
+ 200);
+ my $base = "/root/$flight.$job.$gn-";
+ my $newiso= $base . "newiso";
+ my $emptydir= $base . "empty-dir";
+ my $initrddir= $base . "initrd-dir";
+ my $preseed_file_path = $base . "preseed";
+
+ my @isogen_extra = qw(-eltorito-alt-boot
+ -b boot/grub/efi.img
+ -no-emul-boot
+ -r);
+ my @isogen_opts = (iso_gen_flags_basic(), @isogen_extra);
+
+ iso_create_empty($ho, $emptyiso, $emptydir);
+
+ target_putfilecontents_root_stash($ho, 10, preseed(),
+ $preseed_file_path);
+
+ more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb,
+ OnReboot => 'preserve',
+ Bios => $r{bios},
+ DefVcpus => 4,
+ ExtraConfig => '#nestedhvm=1',
+ PostImageHook => sub {
+ my $cmds = iso_copy_content_from_image($gho, $newiso);
+ $cmds .= prepare_initrd($initrddir,$newiso,$preseed_file_path);
+ target_cmd_root($ho, $cmds, $isotimeout);
+ target_putfilecontents_root_stash($ho, 10, grub_cfg(),
+ "$newiso/debian/boot/grub/grub.cfg");
+
+ target_putfilecontents_root_stash($ho, 10, isolinux_cfg(),
+ "$newiso/isolinux/isolinux.cfg");
+
+ iso_create_genisoimage($ho, $gho->{Rimage}, $newiso, $isotimeout, @isogen_opts);
+ });
+}
+
+# If host has >8G free memory, create a guest with 4G memory to catch
+# any error that triggers cross 4G boundary
+my $host_freemem_mb = host_get_free_memory($ho, $toolstack);
+my $ram_minslop = 100;
+my $ram_lots = 5000;
+if ($host_freemem_mb > $ram_lots * 2 + $ram_minslop) {
+ $ram_mb = $ram_lots;
+} else {
+ $ram_mb = 2048;
+}
+logm("Host has $host_freemem_mb MB free memory, setting guest memory size to $ram_mb MB");
+
+if (!$stage) {
+ prep();
+ guest_create($gho,$toolstack);
+} else {
+ $gho= selectguest($gn,$gho);
+}
+if ($stage<2) {
+ guest_await_reboot($ho,$gho,2000);
+ guest_destroy($ho,$gho);
+}
+
+guest_editconfig_cd($gho);
+guest_create($gho,$toolstack);
+guest_await_dhcp_tcp($gho,300);
+guest_check_up($gho);
+target_cmd_root($gho, "mkdir -p /home/osstest/.ssh && cp /root/.ssh/authorized_keys /home/osstest/.ssh/");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [OSSTEST PATCH 2/4] Building XEN and HVM Dom0 kernel for L1 guest VM
2014-11-28 7:45 [OSSTEST PATCH 0/4] Introduction of the patches longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 1/4] Add nested testcase of preparing and installing L1 guest longtao.pang
@ 2014-11-28 7:45 ` longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 3/4] Add nested test case of installing L2 " longtao.pang
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: longtao.pang @ 2014-11-28 7:45 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, robert.hu, longtaox.pang,
di.zheng
From: "longtao.pang" <longtaox.pang@intel.com>
This patch is used for building XEN and HVM Dom0 kernel for L1 guest VM,
and then reboot L1 guest into xen kernel.
---
sg-run-job | 1 +
ts-nested-L1-debian-install-part2 | 364 +++++++++++++++++++++++++++++++++++++
2 files changed, 365 insertions(+)
create mode 100755 ts-nested-L1-debian-install-part2
diff --git a/sg-run-job b/sg-run-job
index cd8b468..a4c0de1 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -291,6 +291,7 @@ proc run-job/test-pair {} {
proc need-hosts/test-nested {} {return host}
proc run-job/test-nested {} {
run-ts . = ts-nested-L1-debian-install-part1
+ run-ts . = ts-nested-L1-debian-install-part2
}
proc test-guest-migr {g} {
diff --git a/ts-nested-L1-debian-install-part2 b/ts-nested-L1-debian-install-part2
new file mode 100755
index 0000000..2f52edc
--- /dev/null
+++ b/ts-nested-L1-debian-install-part2
@@ -0,0 +1,364 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+# Copyright (C) 2014 Intel Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use Osstest;
+use Osstest::Debian;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost,$gn)= @ARGV;
+$whhost ||= 'host';
+$gn ||= 'nested';
+
+our $ho= selecthost($whhost);
+our $gho;
+our $nested_L2;
+
+my %distpath;
+sub guest_packages () {
+ target_install_packages($gho,
+ qw(bridge-utils vncsnapshot libaio1 libpixman-1-0
+ libsdl1.2debian libglib2.0-0 liblzma5 vim));
+ target_install_packages($gho,
+ $ho->{Suite} =~ /squeeze/ ? "libyajl1" : "libyajl2"); #we always let L1 same as L0
+ if ($ho->{Suite} !~ m/lenny|squeeze/) {
+ target_install_packages($gho, 'libfdt1');
+ }
+ if ($r{arch} eq 'i386') {
+ target_install_packages($gho, 'libc6-xen');
+ }
+ target_install_packages($gho, @{toolstack()->{ExtraPackages}})
+ if toolstack()->{ExtraPackages};
+}
+
+sub guest_extract () {
+ my @parts = ('', 'kern', 'xen');
+ push @parts, 'libvirt' if $r{toolstack} eq "libvirt";
+
+ foreach my $part (@parts) {
+ target_extract_jobdistpath($gho, $part, "path_${part}dist",
+ $r{"${part}buildjob"}, \%distpath);
+ }
+ target_cmd_root($gho, '/sbin/ldconfig');
+}
+
+sub guest_adjustconfig () {
+ target_editfile_root($gho, "/etc/xen/xend-config.sxp",
+ "xend-config.sxp", sub {
+ my (@domains) = (qw(localhost localhost.localdomain),
+ ".".$c{DnsDomain}, ".".$c{TestHostDomain});
+ logm("relocation domains: @domains");
+ foreach (@domains) {
+ s/\./\\$&/g;
+ s/^/^/g;
+ s/$/\$/g;
+ s/^\^(\\\.)/.\*$1/;
+ }
+ $_= join ' ', @domains;
+ s/[\'\\]/\\$&/g;
+ my $extra= "(xend-relocation-hosts-allow '$_')";
+ logm("relocation setting: $extra");
+ $extra .= "\n";
+ while (<EI>) {
+ s/^\s*\(xend-relocation-hosts-allow/#$&/;
+ print EO or die $!;
+ if (m/^\#\(xend-relocation-hosts-allow/) {
+ print EO $extra or die $!;
+ $extra= '';
+ }
+ }
+ print EO $extra or die $!;
+ }) if toolstack()->{Name} eq "xend";
+
+ my $trace_config_file;
+ foreach my $try (qw(/etc/default/xencommons
+ /etc/sysconfig/xencommons
+ /etc/default/xend
+ /etc/sysconfig/xend)) {
+ next unless target_file_exists_root($gho, $try);
+ $trace_config_file= $try;
+ last;
+ }
+ die unless defined $trace_config_file;
+
+ target_editfile_root($gho, $trace_config_file, sub {
+ my $prnow;
+ $prnow= sub {
+ print EO "XENCONSOLED_TRACE=guest\n" or die $!;
+ $prnow= sub { };
+ };
+ while (<EI>) {
+ print EO or die $! unless m/^XENCONSOLED_TRACE/;
+ $prnow->() if m/^#XENCONSOLED_TRACE/;
+ }
+ print EO "\n" or die $!;
+ $prnow->();
+ });
+
+ target_cmd_root($gho, 'mkdir -p /var/log/xen/console');
+
+}
+
+=begin
+sub guest_setupboot () {
+ my $xenhopt= "conswitch=x watchdog";
+
+ my $cons= get_host_property($gho, 'XenSerialConsole', 'com1');
+
+ if ( $cons eq "com1" ) {
+ $xenhopt .= " com1=$c{Baud},8n1 console=com1,vga gdb=com1";
+ } elsif ( $cons eq "dtuart" ) {
+ $xenhopt .= " console=dtuart";
+ my $dtuart= get_host_property($gho, 'XenDTUARTPath', undef);
+ $xenhopt .= " dtuart=$dtuart" if $dtuart;
+ } else {
+ logm("No Xen console device defined for L1 Xen");
+ }
+ if (toolstack()->{Dom0MemFixed}) {
+ $xenhopt .= " dom0_mem=1G,max:1G";
+ }
+ my $append= $r{xen_boot_append};
+ $xenhopt .= " $append" if defined $append;
+ $append = get_host_property($gho, 'xen-commandline-append', undef);
+ $xenhopt .= " $append" if defined $append;
+ my @hooks;
+ host_get_pcipassthrough_devs($ho);
+ logm("pci passthrough: hiding in dom0: $hide");
+ $$kopt .= $hide;
+ }
+ };
+ }
+
+ my $want_kernver = get_runvar('kernel_ver',$r{'kernbuildjob'});
+ debian_boot_setup($gho, $want_kernver, $xenhopt, \%distpath);
+
+ logm("ready to boot L1 Xen");
+}
+=end
+=cut
+
+sub setupboot_L1_grub ($$$) {
+ my ($ho,$want_kernver,$xenhopt,$xenkopt) = @_;
+ my $bl= { };
+ my $rmenu= '/boot/grub/grub.cfg';
+ my $kernkey= (defined $xenhopt ? 'KernDom0' : 'KernOnly');
+ my $parsemenu= sub {
+ my $f= bl_getmenu_open($ho, $rmenu, "$stash/$ho->{Name}--grub.cfg.1");
+
+ my $count= 0;
+ my $entry;
+ my $submenu;
+ while (<$f>) {
+ next if m/^\s*\#/ || !m/\S/;
+ if (m/^\s*\}\s*$/) {
+ die unless $entry || $submenu;
+ if(!defined $entry && defined $submenu){
+ logm("Met end of a submenu starting from $submenu->{StartLine}. Our want kern is $want_kernver");
+ $submenu=undef;
+ next;
+ }
+ my (@missing) =
+ grep { !defined $entry->{$_} } (defined $xenhopt ? qw(Title Hv KernDom0 KernVer) : qw(Title Hv KernOnly KernVer));
+ if (@missing) {
+ logm("(skipping entry at $entry->{StartLine};".
+ " no @missing)");
+ } elsif (defined $want_kernver &&
+ $entry->{KernVer} ne $want_kernver) {
+ logm("(skipping entry at $entry->{StartLine};".
+ " kernel $entry->{KernVer}, not $want_kernver)");
+ } else {
+ # yes!
+ last;
+ }
+ $entry= undef;
+ next;
+ }
+ if (m/^function.*\{/) {
+ $entry= { StartLine => $. };
+ }
+ if (m/^menuentry\s+[\'\"](.*)[\'\"].*\{\s*$/) {
+ die $entry->{StartLine} if $entry;
+ $entry= { Title => $1, StartLine => $., Number => $count };
+ $count++;
+ }
+ if(m/^submenu\s+[\'\"](.*)[\'\"].*\{\s*$/){
+ $submenu={ StartLine =>$.};
+ }
+ if (m/^\s*multiboot\s*(?:\/boot)*\/(xen\S+)/) {
+ die unless $entry;
+ $entry->{Hv}= $1;
+ }
+ if (m/^\s*multiboot\s*(?:\/boot)*\/(vmlinu[xz]-(\S+))/) {
+ die unless $entry;
+ $entry->{KernOnly}= $1;
+ $entry->{KernVer}= $2;
+ }
+ if (m/^\s*module\s*(?:\/boot)*\/(vmlinu[xz]-(\S+))/) {
+ die unless $entry;
+ $entry->{KernDom0}= $1;
+ $entry->{KernVer}= $2;
+ }
+ if (m/^\s*module\s*(?:\/boot)*\/(initrd\S+)/) {
+ $entry->{Initrd}= $1;
+ }
+ }
+ die 'grub 2 bootloader entry not found' unless $entry;
+
+ die unless $entry->{Title};
+
+ logm("boot check: grub2, found $entry->{Title}");
+
+ die unless $entry->{$kernkey};
+ if (defined $xenhopt) {
+ die unless $entry->{Hv};
+ }
+
+ return $entry;
+ };
+
+
+ $bl->{UpdateConfig}= sub {
+ my ( $ho ) = @_;
+ target_cmd_root($ho, "update-grub");
+ };
+
+ $bl->{GetBootKern}= sub { return $parsemenu->()->{$kernkey}; };
+
+ $bl->{PreFinalUpdate}= sub {
+ my $entry= $parsemenu->();
+
+ target_editfile_root($ho, '/etc/default/grub', sub {
+ my %k;
+ while (<::EI>) {
+ next if m/^GRUB_DEFAULT/;
+ print ::EO;
+ }
+ print ::EO <<END or die $!;
+
+GRUB_DEFAULT=$entry->{Number}
+END
+ });
+ };
+
+ return $bl;
+}
+
+our $initscripts_nobridge;
+sub guest_setupinitd () {
+ my $ts= toolstack();
+ my $xencommons= '/etc/init.d/xencommons';
+ my $have_xencommons=
+ !!target_cmd_output_root($gho, <<END);
+ if test -f $xencommons && ! grep 'FOR USE WITH LIBXL' $xencommons >/dev/null
+ then
+ echo y
+ fi
+END
+ $initscripts_nobridge= !defined($ts->{OldDaemonInitd}) || $have_xencommons;
+ logm("init.d scripts ".
+ ($initscripts_nobridge
+ ? 'do not mess with bridge, doing it in interfaces(5)'
+ : '_do_ mess with bridge, letting them handle it'));
+ my $cmd= '';
+ my $updatercd= sub {
+ my ($script,$start) = @_;
+ $cmd .= "\n update-rc.d $script start $start 2 .";
+ };
+ if ($initscripts_nobridge) {
+ my $script= $have_xencommons ? 'xencommons' : 'xenlightdaemons';
+ $updatercd->($script,92);
+ my $pri= 93;
+ foreach my $d (@{ $ts->{NewDaemons} }) {
+ $updatercd->("$d",$pri);
+ $pri++;
+ }
+ } else {
+ my $initd= $ts->{OldDaemonInitd};
+ $updatercd->($initd,93) if defined $initd;
+ $updatercd->('xenbridge',38) if $ts->{OldSeparateBridgeInitd};
+ }
+ target_cmd_root($gho, $cmd);
+}
+
+sub bl_getmenu_open ($$$) {
+ my ($ho, $rmenu, $lmenu) = @_;
+ target_getfile($ho, 60, $rmenu, $lmenu);
+ my $f= new IO::File $lmenu, 'r' or die "$lmenu $?";
+ return $f;
+}
+
+sub setup_l1_bridge($)
+{
+ my ($ho)=@_;
+ my $bridge_port;
+ my $route_output=target_cmd_output_root($ho,"route -n");
+ foreach my $line (split /\n/, $route_output){
+ if($line =~ m/^\s*(?:(?:0\.0\.0\.0)|default).*\s(\w+)\s*$/ai){
+ $bridge_port=$1;
+ logm("get L1 bridge phy port $bridge_port");
+ last;
+ }
+ }
+ die "cannot find L1 port for xenbr0 bridge" if !defined $bridge_port;
+
+ target_editfile_root($ho, "/etc/network/interfaces",
+ "etc-network-interfaces",
+ sub {
+ while(<EI>){
+ s/^\s*iface\s*$bridge_port\s*inet.*dhcp\s*$/iface $bridge_port inet manual\nauto xenbr0\niface xenbr0 inet dhcp\n\tbridge_ports $bridge_port\n/;
+ s/^\s*auto\s*$bridge_port/#auto\t$bridge_port/;
+ print EO;
+ }
+ });
+ target_cmd_root($ho,"brctl addbr xenbr0; brctl addif xenbr0 $bridge_port; init 6");
+}
+
+
+$gho= selectguest($gn,$ho);
+store_runvar("$gho->{Guest}_kernkind",$r{'kernkind'});
+$gho->{Suite}=$ho->{Suite};
+
+guest_check_ip($gho);
+guest_packages();
+guest_extract();
+guest_adjustconfig();
+my $want_kernver = get_runvar('kernel_ver',$r{'kernbuildjob'});
+my $bootloader;
+$bootloader=setupboot_L1_grub($gho, $want_kernver, "");
+
+
+target_cmd_root($gho,
+ "update-initramfs -k $want_kernver -c ||".
+ " update-initramfs -k $want_kernver -u",
+ 200);
+$bootloader->{UpdateConfig}($gho); #so that /boot/grub/grub.cfg have new kernel and xen
+$bootloader->{PreFinalUpdate}(); #update /etc/default/grub, by setting default entry we want
+
+guest_setupinitd ();
+$bootloader->{UpdateConfig}($gho); #use the default entry, apply it to /boot/grub/grub.cfg
+guest_editconfig($gho->{Host}, $gho, sub {
+ s/#nestedhvm/nestedhvm/;
+ });
+target_cmd_root($gho,"sync");
+setup_l1_bridge($gho); #after setup L1 bridge, it will reboot for network settiings to take effect
+logm("ready to reboot L1 Xen");
+guest_await($gho, target_var($gho,'boot_timeout'));
+guest_check_up($gho);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [OSSTEST PATCH 3/4] Add nested test case of installing L2 guest VM
2014-11-28 7:45 [OSSTEST PATCH 0/4] Introduction of the patches longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 1/4] Add nested testcase of preparing and installing L1 guest longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 2/4] Building XEN and HVM Dom0 kernel for L1 guest VM longtao.pang
@ 2014-11-28 7:45 ` longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 4/4] Insert nested test job name and runvars longtao.pang
2014-11-28 12:26 ` [OSSTEST PATCH 0/4] Introduction of the patches Ian Jackson
4 siblings, 0 replies; 10+ messages in thread
From: longtao.pang @ 2014-11-28 7:45 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, robert.hu, longtaox.pang,
di.zheng
From: "longtao.pang" <longtaox.pang@intel.com>
This patch is used for installing L2 guest VM inside L1 guest VM.
---
sg-run-job | 2 +
ts-debian-install | 166 +++++++++++++++++++++++++++++++++++++++++------------
2 files changed, 132 insertions(+), 36 deletions(-)
diff --git a/sg-run-job b/sg-run-job
index a4c0de1..7c0c6ca 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -292,6 +292,8 @@ proc need-hosts/test-nested {} {return host}
proc run-job/test-nested {} {
run-ts . = ts-nested-L1-debian-install-part1
run-ts . = ts-nested-L1-debian-install-part2
+ run-ts . = ts-debian-install + host + nested + amd64 + nested_L2
+ run-ts . = ts-guest-destroy + host nested
}
proc test-guest-migr {g} {
diff --git a/ts-debian-install b/ts-debian-install
index 58ea743..2ca54e8 100755
--- a/ts-debian-install
+++ b/ts-debian-install
@@ -22,41 +22,61 @@ use Osstest::TestSupport;
tsreadconfig();
-our ($whhost,$gn) = @ARGV;
-$whhost ||= 'host';
-$gn ||= 'debian';
+our ($whhost,$gn,$arch,$nested_L2) = @ARGV;
+$nested_L2 ||= '';
-our $ho= selecthost($whhost);
+if($nested_L2 eq 'nested_L2') {
+ my $L1_IP = &get_VM_IP($r{'nested_ether'});
+ $whhost = "host=$L1_IP";
+ $gn ||= 'nested';
+ $arch ||= 'amd64';
+} else {
+ $whhost ||= 'host';
+ $gn ||= 'debian';
+}
+our $ho= selecthost($whhost);
our $ram_mb= 512;
our $swap_mb= 1000;
our $disk_mb= 10000;
-
our $guesthost= "$gn.guest.osstest";
our $gho;
+our $L2_MAC = select_ether($ho,"L2_ether");
sub prep () {
target_install_packages_norec($ho, qw(lvm2 xen-tools));
-
- $gho= prepareguest($ho, $gn, $guesthost, 22,
- $swap_mb + $disk_mb + 2,
- 40);
- target_cmd_root($ho, "umount $gho->{Lvdev} ||:");
+ unless($nested_L2 eq 'nested_L2') {
+ $gho= prepareguest($ho, $gn, $guesthost, 22,
+ $swap_mb + $disk_mb + 2,
+ 40);
+ target_cmd_root($ho, "umount $gho->{Lvdev} ||:");
+ }
}
sub ginstall () {
- my $arch= $r{"$gho->{Guest}_arch"};
+ my $gsuite;
+ my $kernpath;
+ my $initrd;
+ my $kernver;
+ if($nested_L2 eq 'nested_L2'){
+ my $suite= "$c{DebianSuite}";
+ $gsuite= defined($suite) ? "--dist=$suite" : '';
+ $kernver ||= target_cmd_output_root($ho, 'uname -r');
+ $kernpath = "/boot/vmlinuz-$kernver";
+ $initrd ||= "/boot/initrd.img-$kernver";
+ } else {
+ my $arch= $r{"$gho->{Guest}_arch"};
+ $gsuite= guest_var($gho,'suite',$c{GuestDebianSuite});
+ $kernpath = guest_var($gho,'kernel_path',$r{xen_kernel_path});
+ $initrd = guest_var($gho,'initrd_path',$r{xen_initrd_path});
+ if (!$kernpath) {
+ $kernver= guest_var($gho,'kernel_ver',$r{xen_kernel_ver});
+ $kernver ||= target_cmd_output($ho, 'uname -r');
+ $kernpath = "/boot/vmlinuz-$kernver";
+ $initrd ||= "/boot/initrd.img-$kernver";
+ }
+ }
my $archarg= defined($arch) ? "--arch $arch" : '';
- my $gsuite= guest_var($gho,'suite',$c{GuestDebianSuite});
-
- my $kernpath = guest_var($gho,'kernel_path',$r{xen_kernel_path});
- my $initrd = guest_var($gho,'initrd_path',$r{xen_initrd_path});
- if (!$kernpath) {
- my $kernver= guest_var($gho,'kernel_ver',$r{xen_kernel_ver});
- $kernver ||= target_cmd_output($ho, 'uname -r');
- $kernpath = "/boot/vmlinuz-$kernver";
- $initrd ||= "/boot/initrd.img-$kernver";
- }
if (!$initrd) {
$initrd = $kernpath;
$initrd =~ s,/vmlinuz-,/initrd.img-, or die "$initrd ?";
@@ -76,23 +96,97 @@ sub ginstall () {
fi
END
}
- target_cmd_root($ho, <<END, 2000);
- xen-create-image \\
- --dhcp --mac $gho->{Ether} \\
- --memory ${ram_mb}Mb --swap ${swap_mb}Mb \\
- --dist $gsuite \\
- --mirror http://$c{DebianMirrorHost}/$c{DebianMirrorSubpath} \\
- --hostname $gho->{Name} \\
- --lvm $gho->{Vg} --force \\
- --kernel $kernpath \\
- --genpass 0 --password xenroot \\
- $initrd_opt \\
- $archarg
+ if($nested_L2 eq 'nested_L2') {
+ target_cmd_root($ho, <<END, 2000);
+ xen-create-image \\
+ --dhcp --mac=$L2_MAC \\
+ --size=${disk_mb}Mb --memory=${ram_mb}Mb --swap=${swap_mb}Mb \\
+ --mirror=http://$c{DebianMirrorHost}/$c{DebianMirrorSubpath} \\
+ --hostname $guesthost \\
+ --dir=/testnested \\
+ --kernel=$kernpath \\
+ --genpass 0 --password xenroot \\
+ $initrd_opt \\
+ $gsuite \\
+ $archarg
+END
+ } else {
+ target_cmd_root($ho, <<END, 2000);
+ xen-create-image \\
+ --dhcp --mac $gho->{Ether} \\
+ --memory ${ram_mb}Mb --swap ${swap_mb}Mb \\
+ --dist $gsuite \\
+ --mirror http://$c{DebianMirrorHost}/$c{DebianMirrorSubpath} \\
+ --hostname $gho->{Name} \\
+ --lvm $gho->{Vg} --force \\
+ --kernel $kernpath \\
+ --genpass 0 --password xenroot \\
+ $initrd_opt \\
+ $archarg
END
- my $cfg_xend= "/etc/xen/$gho->{Name}.cfg";
- store_runvar("$gho->{Guest}_cfgpath", $cfg_xend);
- store_runvar("$gho->{Guest}_swap_lv", "$gho->{Name}-swap");
+ my $cfg_xend= "/etc/xen/$gho->{Name}.cfg";
+ store_runvar("$gho->{Guest}_cfgpath", $cfg_xend);
+ store_runvar("$gho->{Guest}_swap_lv", "$gho->{Name}-swap");
+ }
+}
+
+sub start () {
+ my $cfg_xend= "/etc/xen/$guesthost.cfg";
+ my $cmd= toolstack()->{Command}." create ".$cfg_xend;
+ target_cmd_root($ho, $cmd, 30);
+ my $domains = target_cmd_output_root($ho, toolstack()->{Command}." list");
+ logm("guest state is\n$domains");
+}
+
+sub get_VM_IP {
+ my $IP;
+ my $leases;
+ my $dhcpf = $c{HostProp_DhcpWatchMethod};
+ my @meth = split /\s+/, $dhcpf;
+ if ($dhcpf =~ m,/,) {
+ $leases= new IO::File $meth[2], 'r';
+ if (!defined $leases) { return "open $meth[2]: $!"; }
+ } else {
+ $leases= new IO::Socket::INET(PeerAddr => $meth[2]);
+ }
+ while (<$leases>) {
+ my @lines = <$leases>;
+ my @newlines = reverse(@lines);
+ for(my $i=0;$i<@newlines;$i++) {
+ next if($newlines[$i] !~ /$_[0]/);
+ for($i;$i<@newlines;$i++) {
+ next if ($newlines[$i] !~ /^lease\s+(\d+\.\d+\.\d+\.\d+)\s*/);
+ $IP = $1;
+ return $IP;
+ }
+ last;
+ }
+ }
+}
+
+sub check_VM_up {
+ my ($g_ip) = @_;
+ my $ping_out = `ping -c 5 $g_ip 2>&1`;
+ if($ping_out =~ m/5 received/) {
+ logm("$guesthost is up and ping is OK!");
+ } else {
+ logm("Failed to boot up $guesthost");
+ }
+}
+
+sub stop_guest {
+ logm("shutdown L2 guest!");
+ target_cmd_root($ho,toolstack()->{Command}." shutdown -w ".$guesthost,100);
}
prep();
ginstall();
+if($nested_L2 eq 'nested_L2') {
+ start();
+ logm("waiting for 15's to boot up L2 guest!");
+ sleep(15);
+ my $L2_IP = get_VM_IP("$L2_MAC");
+ logm("L2 guest's IP is $L2_IP and try to ping it!");
+ check_VM_up($L2_IP);
+ stop_guest();
+}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [OSSTEST PATCH 4/4] Insert nested test job name and runvars
2014-11-28 7:45 [OSSTEST PATCH 0/4] Introduction of the patches longtao.pang
` (2 preceding siblings ...)
2014-11-28 7:45 ` [OSSTEST PATCH 3/4] Add nested test case of installing L2 " longtao.pang
@ 2014-11-28 7:45 ` longtao.pang
2014-11-28 12:26 ` [OSSTEST PATCH 0/4] Introduction of the patches Ian Jackson
4 siblings, 0 replies; 10+ messages in thread
From: longtao.pang @ 2014-11-28 7:45 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, robert.hu, longtaox.pang,
di.zheng
From: "longtao.pang" <longtaox.pang@intel.com>
This patch is used for inserting nested test job name and runvars into
standalone.db database after execute command './standalone-reset'.
---
make-flight | 19 +++++++++++++++++++
mfi-common | 8 ++++++++
2 files changed, 27 insertions(+)
diff --git a/make-flight b/make-flight
index 9963a46..fe64237 100755
--- a/make-flight
+++ b/make-flight
@@ -197,6 +197,24 @@ do_hvm_win7_x64_tests () {
all_hostflags=$most_hostflags,hvm
}
+do_hvm_debian_nested_tests () {
+ if [ $xenarch != amd64 ]; then
+ return
+ fi
+ if [ $dom0arch != amd64 ]; then
+ return
+ fi
+
+ job_create_test test-$xenarch$kern-$dom0arch-nested test-nested xl \
+ $xenarch $dom0arch \
+ nested_image=debian-7.6.0-amd64-DVD-1.iso \
+ bios=seabios \
+ kernbuildjob=build-amd64-hvm \
+ kernkind=hvm \
+ device_model_version=qemu-xen \
+ all_hostflags=$most_hostflags,hvm
+}
+
do_hvm_debian_test_one () {
testname=$1
bios=$2
@@ -364,6 +382,7 @@ test_matrix_do_one () {
fi
+ do_hvm_debian_nested_tests
do_passthrough_tests
}
diff --git a/mfi-common b/mfi-common
index 5c4f5d5..0cc0101 100644
--- a/mfi-common
+++ b/mfi-common
@@ -166,6 +166,14 @@ create_build_jobs () {
revision_qemu=$REVISION_QEMU \
revision_qemuu=$REVISION_QEMU_UPSTREAM
fi
+ ./cs-job-create $flight build-$arch-hvm build-kern \
+ arch=$arch kconfighow=xen-enable-xen-config \
+ $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_RUNVARS $arch_runvars \
+ $suite_runvars \
+ host_hostflags=$build_hostflags \
+ revision_linux=HEAD \
+ tree_linux=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git \
+ ${TREEVCS_LINUX:+treevcs_linux=}${TREEVCS_LINUX}
./cs-job-create $flight build-$arch-pvops build-kern \
arch=$arch kconfighow=xen-enable-xen-config \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [OSSTEST PATCH 0/4] Introduction of the patches.
2014-11-28 7:45 [OSSTEST PATCH 0/4] Introduction of the patches longtao.pang
` (3 preceding siblings ...)
2014-11-28 7:45 ` [OSSTEST PATCH 4/4] Insert nested test job name and runvars longtao.pang
@ 2014-11-28 12:26 ` Ian Jackson
2014-12-01 5:27 ` Hu, Robert
4 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2014-11-28 12:26 UTC (permalink / raw)
To: longtao.pang; +Cc: robert.hu, wei.liu2, Ian.Campbell, di.zheng, xen-devel
longtao.pang writes ("[OSSTEST PATCH 0/4] Introduction of the patches."):
> We updated these patchs about adding Nested test job into OSSTest.
Thanks for your contribution.
Having some testing of nested HVM would be good.
But I'm not convinced that these patches take the right approach to
achieving that. There seems to be a great deal of duplication of
code. I think we should have a conversation about what moving parts
are necessary for nested HVM testing.
I would guess that you could reuse ts-debian-hvm-install for the
initial install of the L1 guest, and then ts-xen-install to install
Xen on it. Finally, you could run some other ts-* scripts to install
your L2 guests. I think you would probably find that there are only
some small changes needed to make those existing scripts flexible
enough.
And I don't understand why you need to rebuild anything. Surely the
already-built hypervisor and tools ought to work just as well in the
L1 guest ?
Thanks,
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [OSSTEST PATCH 0/4] Introduction of the patches.
2014-11-28 12:26 ` [OSSTEST PATCH 0/4] Introduction of the patches Ian Jackson
@ 2014-12-01 5:27 ` Hu, Robert
2014-12-01 9:32 ` Ian Campbell
0 siblings, 1 reply; 10+ messages in thread
From: Hu, Robert @ 2014-12-01 5:27 UTC (permalink / raw)
To: Ian Jackson, Pang, LongtaoX
Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com, Zheng, Di,
xen-devel@lists.xen.org
> -----Original Message-----
> From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com]
> Sent: Friday, November 28, 2014 8:26 PM
> To: Pang, LongtaoX
> Cc: xen-devel@lists.xen.org; Ian.Campbell@citrix.com; wei.liu2@citrix.com;
> Hu, Robert; Zheng, Di
> Subject: Re: [OSSTEST PATCH 0/4] Introduction of the patches.
>
> longtao.pang writes ("[OSSTEST PATCH 0/4] Introduction of the patches."):
> > We updated these patchs about adding Nested test job into OSSTest.
>
> Thanks for your contribution.
>
> Having some testing of nested HVM would be good.
Hi Ian, thanks for your support and glad getting your attention on this.
We're new to osstest, and didn't find much documentation on its framework.
So might violate some design and/or convention of it. We will modify as we get more conception of it.
>
> But I'm not convinced that these patches take the right approach to
> achieving that. There seems to be a great deal of duplication of
> code. I think we should have a conversation about what moving parts
> are necessary for nested HVM testing.
Agree with you we shall reuse existing ts-* if possible. Actually I had thought of this approach but later I
defeated myself because I thought ts-* shall compromise itself as a whole test case and better not to touch them.
Now I see that ts- is more like components to constitute a test case (my current understanding is your job == test cases).
If we had some documentation illustrating the your hierarchy of design, we should have less misunderstanding.
>
> I would guess that you could reuse ts-debian-hvm-install for the
> initial install of the L1 guest, and then ts-xen-install to install
> Xen on it. Finally, you could run some other ts-* scripts to install
> your L2 guests. I think you would probably find that there are only
> some small changes needed to make those existing scripts flexible
> enough.
OK, we're going to do this, try to use ts-debian-hvm-install to fulfill the step of L1 dom0;
use ts-xen-install to fulfil next step of constructing the normal guest to a L1 Xen environment.
We will probably changes some of ts-debian-hvm-install and ts-xen-install to fulfill our test case.
e.g., we may use some different configuration for L1, we will parameterize some configurations which now is hard-coded.
>
> And I don't understand why you need to rebuild anything. Surely the
> already-built hypervisor and tools ought to work just as well in the
> L1 guest ?
We'll refine these parts to re-use existing things as much as possible.
>
> Thanks,
> Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [OSSTEST PATCH 0/4] Introduction of the patches.
2014-12-01 5:27 ` Hu, Robert
@ 2014-12-01 9:32 ` Ian Campbell
0 siblings, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2014-12-01 9:32 UTC (permalink / raw)
To: Hu, Robert
Cc: wei.liu2@citrix.com, Pang, LongtaoX, Ian Jackson, Zheng, Di,
xen-devel@lists.xen.org
On Mon, 2014-12-01 at 05:27 +0000, Hu, Robert wrote:
> > But I'm not convinced that these patches take the right approach to
> > achieving that. There seems to be a great deal of duplication of
> > code. I think we should have a conversation about what moving parts
> > are necessary for nested HVM testing.
> Agree with you we shall reuse existing ts-* if possible. Actually I had thought of this approach but later I
> defeated myself because I thought ts-* shall compromise itself as a whole test case and better not to touch them.
> Now I see that ts- is more like components to constitute a test case (my current understanding is your job == test cases).
Have you seen the README at the top-level of osstest.git? It starts with
a terminology section, which includes defining what a job is: a sequence
of test steps, which could also be called a test case. The ts-* prefix
stands for test step BTW.
There is certainly scope for improving the docs though so please do ask
if anything is unclear and we can improve the docs.
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [OSSTEST PATCH 0/4] Introduction of the patches.
@ 2014-12-10 8:07 longtao.pang
2014-12-11 10:38 ` Wei Liu
0 siblings, 1 reply; 10+ messages in thread
From: longtao.pang @ 2014-12-10 8:07 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, robert.hu, longtaox.pang,
di.zheng
We updated these patchs(version_3) again about adding Nested test job into OSSTest.
Nested virtualization is the function of running a hypervisor inside a virtual machine.
The hypervisor that runs on the real hardware is called a level 0 or L0;
The hypervisor that runs as a guest inside L0 is called level 1 or L1;
A guest that running inside the L1 hypervisor is called a level 2 or L2.
For running nested test job, we should run build-amd64 job and build-amd64-hvm job first.
During the testing, it will install L1 guest VM inside L0,
the L1 guest should build xen and HVM Dom0 kernel and then boot into xen kernel.
Next, begin to install L2 guest VM inside L1.
After that, make sure ping L2 is successfully
----------------------------------------------------------------
longtao.pang (4):
Add nested testcase of preparing and installing L1 guest VM
Build XEN and HVM Dom0 kernel for L1 guest VM
Add nested testcase of installing L2 guest VM
Insert nested test job name and runvars
Osstest/Debian.pm | 27 +++++---
Osstest/TestSupport.pm | 31 +++++++--
make-flight | 19 ++++++
mfi-common | 8 +++
sg-run-job | 8 +++
ts-debian-hvm-install | 34 +++++++---
ts-debian-install | 166 +++++++++++++++++++++++++++++++++++++-----------
ts-xen-install | 149 +++++++++++++++++++++++++++++++------------
8 files changed, 343 insertions(+), 99 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [OSSTEST PATCH 0/4] Introduction of the patches.
2014-12-10 8:07 longtao.pang
@ 2014-12-11 10:38 ` Wei Liu
0 siblings, 0 replies; 10+ messages in thread
From: Wei Liu @ 2014-12-11 10:38 UTC (permalink / raw)
To: longtao.pang
Cc: wei.liu2, Ian.Campbell, Ian.Jackson, xen-devel, robert.hu,
di.zheng
Please use clear subject line in the future. Currently it's not very
descriptive. Something like "Introduction of netsted HVM test case" is
better.
Wei.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-12-11 10:38 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28 7:45 [OSSTEST PATCH 0/4] Introduction of the patches longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 1/4] Add nested testcase of preparing and installing L1 guest longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 2/4] Building XEN and HVM Dom0 kernel for L1 guest VM longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 3/4] Add nested test case of installing L2 " longtao.pang
2014-11-28 7:45 ` [OSSTEST PATCH 4/4] Insert nested test job name and runvars longtao.pang
2014-11-28 12:26 ` [OSSTEST PATCH 0/4] Introduction of the patches Ian Jackson
2014-12-01 5:27 ` Hu, Robert
2014-12-01 9:32 ` Ian Campbell
-- strict thread matches above, loose matches on Subject: below --
2014-12-10 8:07 longtao.pang
2014-12-11 10:38 ` Wei Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.