[lxc-devel] [pylxd/master] Tidy up integration script tests

ajkavanagh on Github lxc-bot at linuxcontainers.org
Fri Sep 21 07:57:48 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 478 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180921/5ebd4bfa/attachment.bin>
-------------- next part --------------
From 966566403ea94b91aabefed06737d53d29c15fec Mon Sep 17 00:00:00 2001
From: Alex Kavanagh <alex at ajkavanagh.co.uk>
Date: Fri, 21 Sep 2018 09:55:56 +0200
Subject: [PATCH] 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.
---
 integration/run_integration_tests                   | 13 +++++++++++++
 .../run_integration_tests-16-04                     |  2 +-
 .../run_integration_tests-18-04                     |  2 +-
 run_integration_tests                               |  1 -
 4 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100755 integration/run_integration_tests
 rename run_integration_tests-16-04 => integration/run_integration_tests-16-04 (92%)
 rename run_integration_tests-18-04 => integration/run_integration_tests-18-04 (95%)
 delete mode 120000 run_integration_tests

diff --git a/integration/run_integration_tests b/integration/run_integration_tests
new file mode 100755
index 0000000..8c1372b
--- /dev/null
+++ b/integration/run_integration_tests
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -ex
+
+_dir="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
+_release=$(lsb_release -c | cut -f 2)
+
+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
diff --git a/run_integration_tests-16-04 b/integration/run_integration_tests-16-04
similarity index 92%
rename from run_integration_tests-16-04
rename to integration/run_integration_tests-16-04
index c1467db..e105330 100755
--- a/run_integration_tests-16-04
+++ b/integration/run_integration_tests-16-04
@@ -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
diff --git a/run_integration_tests-18-04 b/integration/run_integration_tests-18-04
similarity index 95%
rename from run_integration_tests-18-04
rename to integration/run_integration_tests-18-04
index 00980f8..99e00fd 100755
--- a/run_integration_tests-18-04
+++ b/integration/run_integration_tests-18-04
@@ -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
diff --git a/run_integration_tests b/run_integration_tests
deleted file mode 120000
index ae09ea3..0000000
--- a/run_integration_tests
+++ /dev/null
@@ -1 +0,0 @@
-run_integration_tests-18-04
\ No newline at end of file


More information about the lxc-devel mailing list