]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: Don't hardcode architecture
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 11 Feb 2014 23:49:39 +0000 (18:49 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 12 Feb 2014 00:42:28 +0000 (19:42 -0500)
If on Ubuntu, then match the host's own architecture, this should allow
for our tests to pass on the armhf CI environment.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/tests/lxc-test-autostart
src/tests/lxc-test-unpriv
src/tests/lxc-test-usernic.in

index 6c2acb03027a894910e8f5a20173814477a4cf5c..62fff26087fbb6c561a63d9bbfc56df730ec3463 100755 (executable)
@@ -32,12 +32,17 @@ cleanup() {
        echo "PASS"
 }
 
+ARCH=i386
+if type dpkg >/dev/null 2>&1; then
+       ARCH=$(dpkg --print-architecture)
+fi
+
 trap cleanup EXIT HUP INT TERM
 set -eu
 
 # Create a container
 CONTAINER_NAME=lxc-test-auto
-lxc-create -t download -n $CONTAINER_NAME -- -d ubuntu -r trusty -a i386
+lxc-create -t download -n $CONTAINER_NAME -- -d ubuntu -r trusty -a $ARCH
 CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs -H))
 cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak
 
index 9e3fe211d69046a93dfa309ecd30c63273f093dc..cc0a8609b98b86d7fa7f79a9148c3d650b8da9f2 100755 (executable)
@@ -62,6 +62,11 @@ run_cmd() {
 TUSER=lxcunpriv
 HDIR=/home/$TUSER
 
+ARCH=i386
+if type dpkg >/dev/null 2>&1; then
+       ARCH=$(dpkg --print-architecture)
+fi
+
 trap cleanup EXIT SIGHUP SIGINT SIGTERM
 set -eu
 
@@ -94,7 +99,7 @@ for d in /sys/fs/cgroup/*; do
        echo $$ > $d/lxctest/tasks
 done
 
-run_cmd lxc-create -t download -n c1 -- -d ubuntu -r trusty -a i386
+run_cmd lxc-create -t download -n c1 -- -d ubuntu -r trusty -a $ARCH
 run_cmd lxc-start -n c1 -d
 
 p1=$(run_cmd lxc-info -n c1 -p -H)
index 4f96d2eaeaf54002c7afae03a10558f22f172701..0a514ee47517446c00aaa75cfe3546fbcc28620e 100755 (executable)
@@ -64,6 +64,11 @@ run_cmd() {
        fi
 }
 
+ARCH=i386
+if type dpkg >/dev/null 2>&1; then
+       ARCH=$(dpkg --print-architecture)
+fi
+
 set -eu
 trap cleanup EXIT SIGHUP SIGINT SIGTERM
 
@@ -96,8 +101,13 @@ brctl addbr usernic-br1
 ifconfig usernic-br0 0.0.0.0 up
 ifconfig usernic-br1 0.0.0.0 up
 
+ARCH=i386
+if type dpkg >/dev/null 2>&1; then
+       ARCH=$(dpkg --print-architecture)
+fi
+
 # Create three containers
-run_cmd "lxc-create -t download -n b1 -- -d ubuntu -r trusty -a i386"
+run_cmd "lxc-create -t download -n b1 -- -d ubuntu -r trusty -a $ARCH"
 run_cmd "lxc-start -n b1 -d"
 p1=$(run_cmd "lxc-info -n b1 -p -H")