From 8162feac1017eeddf69049ef75abaa7a51043b23 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 11 Aug 2022 11:32:21 +0200 Subject: [PATCH 1/2] semaphore: drop the --keyserver= parameter for the download template since it's no longer supported/necessary. See: https://github.com/lxc/lxc/commit/58520263041b6864cadad96278848f9b8ce78ee9 --- .semaphore/semaphore-runner.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.semaphore/semaphore-runner.sh b/.semaphore/semaphore-runner.sh index ba21811718..a509473b17 100755 --- a/.semaphore/semaphore-runner.sh +++ b/.semaphore/semaphore-runner.sh @@ -19,14 +19,7 @@ PHASES=(${@:-SETUP RUN}) UBUNTU_RELEASE="$(lsb_release -cs)" create_container() { - # Create autopkgtest LXC image; this sometimes fails with "Unable to fetch - # GPG key from keyserver", so retry a few times with different keyservers. - for keyserver in "keys.openpgp.org" "" "keyserver.ubuntu.com" "keys.gnupg.net"; do - for retry in {1..5}; do - sudo lxc-create -n "$CONTAINER" -t download -- -d "$DISTRO" -r "$RELEASE" -a "$ARCH" ${keyserver:+--keyserver "$keyserver"} && break 2 - sleep $((retry*retry)) - done - done + sudo lxc-create -n "$CONTAINER" -t download -- -d "$DISTRO" -r "$RELEASE" -a "$ARCH" # unconfine the container, otherwise some tests fail echo 'lxc.apparmor.profile = unconfined' | sudo tee -a "/var/lib/lxc/$CONTAINER/config" From 3b9ac80085ce4acc5bd932d4961d52531a7fc1a4 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 11 Aug 2022 13:36:15 +0200 Subject: [PATCH 2/2] semaphore: run autopkgtest with sudo Otherwise it can't access the newly create LXC container: ``` autopkgtest-virt-lxc: DBG: wait_booted: detecting init system failed, retrying... autopkgtest-virt-lxc: DBG: stderr: lxc-attach: autopkgtest-lxc-trjmpu: tools/lxc_attach.c: main: 302 You lack access to /home/semaphore/.local/share/lxc ``` --- .semaphore/semaphore-runner.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.semaphore/semaphore-runner.sh b/.semaphore/semaphore-runner.sh index a509473b17..98fd7b4411 100755 --- a/.semaphore/semaphore-runner.sh +++ b/.semaphore/semaphore-runner.sh @@ -100,10 +100,10 @@ EOF # now build the package and run the tests rm -rf "$ARTIFACTS_DIR" # autopkgtest exits with 2 for "some tests skipped", accept that - "$AUTOPKGTEST_DIR/runner/autopkgtest" --env DEB_BUILD_OPTIONS=noudeb \ - --env TEST_UPSTREAM=1 ../systemd_*.dsc \ - -o "$ARTIFACTS_DIR" \ - -- lxc -s "$CONTAINER" \ + sudo "$AUTOPKGTEST_DIR/runner/autopkgtest" --env DEB_BUILD_OPTIONS=noudeb \ + --env TEST_UPSTREAM=1 ../systemd_*.dsc \ + -o "$ARTIFACTS_DIR" \ + -- lxc -s "$CONTAINER" \ || [ $? -eq 2 ] ;; *)