test-in-lxd: remove privileged container usage (#974)

* test-in-lxd: remove privileged container usage

* Don't assume certain home directory name

* Try enabling groovy
This commit is contained in:
Dan Bungert 2021-06-07 14:36:37 -06:00 committed by GitHub
parent 15f995096e
commit 1d42f897a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -10,6 +10,7 @@ jobs:
image:
- ubuntu-daily:bionic
- ubuntu-daily:focal
- ubuntu-daily:groovy
- ubuntu-daily:hirsute
- ubuntu-daily:impish
steps:

View File

@ -5,8 +5,15 @@ SCRIPT=$2
lxd init --auto
lxc launch $IMAGE tester -c security.privileged=true
lxc launch $IMAGE tester
lxc config device add tester code disk source=`pwd` path=/subiquity
# copy is allowed to fail, in case the subiquity directory being tested
# includes some uncopyable stuff
lxc exec tester -- sh -ec "
cd ~
sudo cp -a /subiquity . || true
[ -d ~/subiquity ]
"
attempts=0
while ! lxc file pull tester/etc/resolv.conf - 2> /dev/null | grep -q ^nameserver; do
@ -32,4 +39,7 @@ then
done
fi
lxc exec tester -- sh -c "cd /subiquity && ./scripts/installdeps.sh && $SCRIPT"
lxc exec tester -- sh -ec "
cd ~/subiquity
./scripts/installdeps.sh
$SCRIPT"