Skip to content

Commit

Permalink
Tidy up integration script tests (#329)
Browse files Browse the repository at this point in the history
* Tidy up integration script tests

Move the scripts to the integration/ directory, and enable the
`run_integration_tests` script to choose the Ubuntu version specific
script based on the output of lsb_release.

* shorten the lsb_release subcommand

Signed-off-by: Alex Kavanagh <alex@ajkavanagh.co.uk>
  • Loading branch information
ajkavanagh authored Sep 21, 2018
1 parent 131e22f commit 7db6143
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
13 changes: 13 additions & 0 deletions integration/run_integration_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -ex

_dir="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
_release=$(lsb_release -cs)

if [[ "${_release}" == "bionic" ]]; then
echo "Running Bionic (18:04) integration tests"
exec ${_dir}/run_integration_tests-18-04
else
echo "Running Xenial (16:04) integration tests"
exec ${_dir}/run_integration_tests-16-04
fi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ lxc exec $CONTAINER_NAME -- lxc config set core.https_address [::]
lxc exec $CONTAINER_NAME -- mkdir -p /opt/pylxd
# NOTE: rockstar (13 Sep 2016) - --recursive is not supported in lxd <2.1, so
# until we have pervasive support for that, we'll do this tar hack.
tar cf - * .git | lxc exec $CONTAINER_NAME -- tar xf - -C /opt/pylxd
cd .. && tar cf - ../* ../.git | lxc exec $CONTAINER_NAME -- tar xf - -C /opt/pylxd
lxc exec $CONTAINER_NAME -- /bin/sh -c "cd /opt/pylxd && tox -eintegration"
lxc delete --force $CONTAINER_NAME
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ lxc exec $CONTAINER_NAME -- lxc profile device add default root disk path=/ pool
lxc exec $CONTAINER_NAME -- mkdir -p /opt/pylxd
# NOTE: rockstar (13 Sep 2016) - --recursive is not supported in lxd <2.1, so
# until we have pervasive support for that, we'll do this tar hack.
tar cf - * .git | lxc exec $CONTAINER_NAME -- tar xf - -C /opt/pylxd
cd .. && tar cf - * .git | lxc exec $CONTAINER_NAME -- tar xf - -C /opt/pylxd
lxc exec $CONTAINER_NAME -- /bin/sh -c "cd /opt/pylxd && tox -eintegration"
lxc delete --force $CONTAINER_NAME
1 change: 0 additions & 1 deletion run_integration_tests

This file was deleted.

0 comments on commit 7db6143

Please sign in to comment.