]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
TestSupport: guest_create and guest_destroy take only a $gho.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 16 Jun 2014 16:30:48 +0000 (17:30 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 30 Jan 2015 08:05:52 +0000 (08:05 +0000)
The host can be looked up from $gho->{Host} and the toolstack can be
looked up from the host.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-debian-hvm-install
ts-guest-destroy
ts-guest-destroy-hard
ts-redhat-install
ts-rumpuserxen-demo-xenstorels

index 745e67bb430b93aa240eefc6e07d7e73d4bd8810..47fc45d4fd10d61bc859fb11b8761b21a77f3744 100644 (file)
@@ -1327,14 +1327,16 @@ sub guest_await_shutdown ($$$) {
     return guest_await_state($ho,$gho, "shutdown", "s", $timeout);
 }
 
-sub guest_destroy ($$) {
-    my ($ho,$gho) = @_;
+sub guest_destroy ($) {
+    my ($gho) = @_;
+    my $ho = $gho->{Host};
     target_cmd_root($ho, toolstack($ho)->{Command}." destroy $gho->{Name}", 40);
 }
 
-sub guest_create ($$) {
-    my ($gho,$toolstack) = @_;
-    target_cmd_root($gho->{Host}, "$toolstack create $gho->{CfgPath}", 100);
+sub guest_create ($) {
+    my ($gho) = @_;
+    my $ho = $gho->{Host};
+    target_cmd_root($ho, toolstack($ho)->{Command}." create $gho->{CfgPath}", 100);
 }
 
 
index 0148eef8b5789c289bb6c61e976d9481734dcbff..449b96c579f037fb9883afa6674d437de2077ec1 100755 (executable)
@@ -41,9 +41,6 @@ our $disk_mb= 10000;
 our $guesthost= "$gn.guest.osstest";
 our $gho;
 
-our $toolstack= toolstack($ho)->{Command};
-
-
 sub preseed () {
 
     my $preseed_file = preseed_base('wheezy','',());
@@ -183,16 +180,16 @@ logm("Host has $host_freemem_mb MB free memory, setting guest memory size to $ra
 
 if (!$stage) {
     prep();
-    guest_create($gho,$toolstack);
+    guest_create($gho);
 } else {
     $gho= selectguest($gn,$gho);
 }
 if ($stage<2) {
     guest_await_reboot($ho,$gho,2000);
-    guest_destroy($ho,$gho);
+    guest_destroy($gho);
 }
 
 guest_editconfig_nocd($gho,$emptyiso);
-guest_create($gho,$toolstack);
+guest_create($gho);
 guest_await_dhcp_tcp($gho,300);
 guest_check_up($gho);
index 738650ad1cb1b008c1c26999c589d86ac8bac9db..b4340f6007729f9a529a4187bb4fd0ae60b2b661 100755 (executable)
@@ -25,7 +25,7 @@ tsreadconfig();
 our ($ho,$gho) = ts_get_host_guest(@ARGV);
 
 sub destroy () {
-    guest_destroy($ho, $gho);
+    guest_destroy($gho);
     guest_checkrunning($ho, $gho) and die $gho->{Name};
 }
 
index 457ac72a84c52377852ba32054cf2920a8d857db..57d7100673e5d1d083c589ffebb82ddc46618d13 100755 (executable)
@@ -24,4 +24,4 @@ tsreadconfig();
 
 our ($ho,$gho) = ts_get_host_guest(@ARGV);
 
-guest_destroy($ho, $gho);
+guest_destroy($gho);
index a0b1fab4a1b16be0c3a2dffac75c8e4c3313b395..22c30613d9956a9120e3bc6ef81109cdb9ae1406 100755 (executable)
@@ -37,9 +37,6 @@ our $disk_mb= 50000;
 our $guesthost= "$gn.guest.osstest";
 our $gho;
 
-our $xl= toolstack($ho)->{Command};
-
-
 sub kickstart () {
     my $cryptpw= '$6$anjRJmBbJcrNJGWN$rqvGUhu8ITjvErdIA5C//w2R6b/6wAjHbaF7XF8u3lZg1XI3StthPIE6UII08scOFwASMOepCGpgtsYeCpjqb.';
     my $authkeys= authorized_keys();
@@ -152,16 +149,16 @@ sub prep () {
 
 if (!$stage) {
     prep();
-    guest_create($gho,$xl);
+    guest_create($gho);
 } else {
     $gho= selectguest($gn,$gho);
 }
 if ($stage<2) {
     guest_await_reboot($ho,$gho,2000);
-    guest_destroy($ho,$gho);
+    guest_destroy($gho);
 }
 
 guest_editconfig_nocd($gho,$emptyiso);
-guest_create($gho,$xl);
+guest_create($gho);
 guest_await_dhcp_tcp($gho,300);
 guest_check_up($gho);
index 6698848bebc8f4c93d4a7f61777cf1df7ef8f7bc..ed46843eb3e9d7ce07990287e8819b9a1a82c671 100755 (executable)
@@ -40,7 +40,7 @@ sub arrangepreserve () {
 }
 
 sub start () {
-    guest_create($gho,toolstack($ho));
+    guest_create($gho);
 
     $domid = guest_find_domid($ho, $gho);
 }