Skip to content

Commit 7949ab7

Browse files
authored
Install tests under /root to fix strict confinement issues (#3425)
1 parent 314d845 commit 7949ab7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test-distro.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ function create_machine() {
2525

2626
# Allow for the machine to boot and get an IP
2727
sleep 20
28-
tar cf - ./tests | lxc exec $NAME -- tar xvf - -C /var/tmp
28+
tar cf - ./tests | lxc exec $NAME -- tar xvf - -C /root
2929
DISTRO_DEPS_TMP="${DISTRO//:/_}"
3030
DISTRO_DEPS="${DISTRO_DEPS_TMP////-}"
31-
lxc exec $NAME -- /bin/bash "/var/tmp/tests/lxc/install-deps/$DISTRO_DEPS"
31+
lxc exec $NAME -- /bin/bash "/root/tests/lxc/install-deps/$DISTRO_DEPS"
3232
lxc exec $NAME -- reboot
3333
sleep 20
3434

@@ -77,7 +77,7 @@ fi
7777
NAME=machine-$RANDOM
7878
create_machine $NAME $PROXY
7979
# use 'script' for required tty: https://github.com/lxc/lxd/issues/1724#issuecomment-194416774
80-
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /var/tmp/tests/test-upgrade.py"
80+
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /root/tests/test-upgrade.py"
8181
lxc delete $NAME --force
8282

8383
# Test upgrade-path
@@ -87,9 +87,9 @@ create_machine $NAME $PROXY
8787
if [[ ${TO_CHANNEL} =~ /.*/microk8s.*snap ]]
8888
then
8989
lxc file push ${TO_CHANNEL} $NAME/tmp/microk8s_latest_amd64.snap
90-
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=/tmp/microk8s_latest_amd64.snap pytest -s /var/tmp/tests/test-upgrade-path.py"
90+
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=/tmp/microk8s_latest_amd64.snap pytest -s /root/tests/test-upgrade-path.py"
9191
else
92-
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /var/tmp/tests/test-upgrade-path.py"
92+
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /root/tests/test-upgrade-path.py"
9393
fi
9494
lxc delete $NAME --force
9595

@@ -103,7 +103,7 @@ then
103103
else
104104
lxc exec $NAME -- snap install microk8s --channel=${TO_CHANNEL} --classic
105105
fi
106-
lxc exec $NAME -- /var/tmp/tests/smoke-test.sh
106+
lxc exec $NAME -- /root/tests/smoke-test.sh
107107
# use 'script' for required tty: https://github.com/lxc/lxd/issues/1724#issuecomment-194416774
108108
lxc exec $NAME -- script -e -c "pytest -s /var/snap/microk8s/common/addons/core/tests/test-addons.py"
109109
lxc exec $NAME -- microk8s enable community

0 commit comments

Comments
 (0)