Skip to content

Commit

Permalink
Merge pull request canonical#2068 from ogayot/test-in-lxd-usage
Browse files Browse the repository at this point in the history
test-in-lxd: add usage when not enough args are supplied
  • Loading branch information
ogayot authored Aug 30, 2024
2 parents 1d0378d + fcece97 commit 8aaac20
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions scripts/test-in-lxd.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
#!/bin/bash
set -eux

if [ "$#" -lt 2 ]; then
cat >&2 <<EOF
usage: $0 <lxd-image> <test-command>
positional arguments:
lxd-image the LXD image to launch
test-command the command to run on the container
example:
$0 ubuntu-daily:noble "make check"
EOF
exit 1
fi

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

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

lxc stop $TESTER

0 comments on commit 8aaac20

Please sign in to comment.