Skip to content

Commit

Permalink
Install tests under /root to fix strict confinement issues (#3425)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos authored Sep 7, 2022
1 parent 314d845 commit 7949ab7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ function create_machine() {

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

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

# Test upgrade-path
Expand All @@ -87,9 +87,9 @@ create_machine $NAME $PROXY
if [[ ${TO_CHANNEL} =~ /.*/microk8s.*snap ]]
then
lxc file push ${TO_CHANNEL} $NAME/tmp/microk8s_latest_amd64.snap
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"
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"
else
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"
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /root/tests/test-upgrade-path.py"
fi
lxc delete $NAME --force

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

0 comments on commit 7949ab7

Please sign in to comment.