]> xenbits.xensource.com Git - osstest.git/commitdiff
host reuse: ts-host-reuse: Prepare for argument handling
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 3 Sep 2020 10:57:29 +0000 (11:57 +0100)
committerIan Jackson <iwj@xenproject.org>
Wed, 7 Oct 2020 17:39:48 +0000 (18:39 +0100)
No functional change.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
ts-host-reuse

index aad45bdd08c711a90faa7a153e11dbc831c60e03..21d775005383e1d253009ca3725bd157b80fe80e 100755 (executable)
@@ -48,9 +48,9 @@ use Osstest::TestSupport;
 
 tsreadconfig();
 
-die unless @ARGV==2;
-
-our ($action, $whhost) = @ARGV;
+die unless @ARGV>=2;
+our $action = shift @ARGV;
+our $whhost = shift @ARGV;
 
 our $ho;
 
@@ -137,6 +137,7 @@ sub noop_if_playing () {
 #---------- actions ----------
 
 sub act_prealloc () {
+    die if @ARGV;
     noop_if_playing();
     compute_test_sharetype();
     $ho = selecthost($whhost, undef, 1);
@@ -145,6 +146,7 @@ sub act_prealloc () {
 }
 
 sub act_start_test () {
+    die if @ARGV;
     compute_test_sharetype();
     $ho = selecthost($whhost);
     return unless $ho->{Shared};
@@ -153,6 +155,7 @@ sub act_start_test () {
 }
 
 sub act_post_test_ok () {
+    die if @ARGV;
     compute_test_sharetype();
     $ho = selecthost($whhost);
     return unless $ho->{Shared};