diff mbox series

[OSSTEST,74/82] host reuse: ts-host-reuse: Prepare for argument handling

Message ID 20201007180024.7932-75-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Reuse test hosts | expand

Commit Message

Ian Jackson Oct. 7, 2020, 6 p.m. UTC
From: Ian Jackson <ian.jackson@eu.citrix.com>

No functional change.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 ts-host-reuse | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/ts-host-reuse b/ts-host-reuse
index aad45bdd..21d77500 100755
--- a/ts-host-reuse
+++ b/ts-host-reuse
@@ -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};