Skip to content

Commit

Permalink
test-in-lxd: add usage when not enough args are supplied
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
  • Loading branch information
ogayot committed Aug 27, 2024
1 parent 2adc111 commit 7032bd8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/test-in-lxd.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash
set -eux

if [ "$#" -lt 2 ]; then
cat >&2 <<EOF
Usage: $0 <lxd-image> <test-command>
EOF
exit 1
fi

IMAGE=$1
SCRIPT=$2
TEST_CMD=$2
TESTER=subiquity-${IMAGE##*:}

lxd init --auto
Expand Down Expand Up @@ -62,6 +70,6 @@ fi
lxc exec $TESTER -- sh -ec "
cd ~/subiquity
./scripts/installdeps.sh
$SCRIPT"
$TEST_CMD"

lxc stop $TESTER

0 comments on commit 7032bd8

Please sign in to comment.