From 7032bd8a105ff0e3a787919c7733f7ebb4d5c709 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 27 Aug 2024 12:15:21 +0200 Subject: [PATCH] test-in-lxd: add usage when not enough args are supplied Signed-off-by: Olivier Gayot --- scripts/test-in-lxd.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/test-in-lxd.sh b/scripts/test-in-lxd.sh index 7c82d9571..aaf0ab52a 100755 --- a/scripts/test-in-lxd.sh +++ b/scripts/test-in-lxd.sh @@ -1,7 +1,15 @@ #!/bin/bash set -eux + +if [ "$#" -lt 2 ]; then + cat >&2 < +EOF + exit 1 +fi + IMAGE=$1 -SCRIPT=$2 +TEST_CMD=$2 TESTER=subiquity-${IMAGE##*:} lxd init --auto @@ -62,6 +70,6 @@ fi lxc exec $TESTER -- sh -ec " cd ~/subiquity ./scripts/installdeps.sh - $SCRIPT" + $TEST_CMD" lxc stop $TESTER