From 7e7d3018da228aac77e3dc1e460664af2b1f0763 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 4 Dec 2024 17:07:16 -0500 Subject: [PATCH 1/3] Revert "bin/helpers: unconditionally enable debug logging in install_lxd()" This reverts commit 28943e6ba1b8fcbec0a13331d4c8a5fb8a0743b3. The debug output is unfortunately very hard to read once printed at the GHA runner console. Signed-off-by: Simon Deziel --- bin/helpers | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/helpers b/bin/helpers index ce15523c..dd3170ad 100644 --- a/bin/helpers +++ b/bin/helpers @@ -191,9 +191,6 @@ install_lxd() ( mount --bind "${LXD_AGENT_SIDELOAD_PATH}" /snap/lxd/current/bin/lxd-agent fi - # Enable debug logging if not done already - [ "$(snap get lxd daemon.debug 2>/dev/null)" = "true" ] || snap set lxd daemon.debug=true - if [ "$start_daemon" = "true" ]; then lxd waitready --timeout=300 fi From 362ee8305073efaa3083c2a07d635789b474b6ae Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 4 Dec 2024 17:57:23 -0500 Subject: [PATCH 2/3] tests/lxd-user: test lxd-user daemon Signed-off-by: Simon Deziel --- tests/lxd-user | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tests/lxd-user diff --git a/tests/lxd-user b/tests/lxd-user new file mode 100755 index 00000000..ab5bfc3f --- /dev/null +++ b/tests/lxd-user @@ -0,0 +1,24 @@ +#!/bin/bash +set -eux + +lxc_user() { + sudo -Hu testuser LXD_DIR=/var/snap/lxd/common/lxd-user lxc "${@}" +} + +# Install lxd +install_lxd + +# Create testuser account +useradd -m testuser -G lxd --uid 5000 + +# Access lxd-user +lxc_user info +lxc_user project list +lxc_user project list -f csv | grep '^user-5000.*,"User restricted project for ""testuser"" (5000)",' + +# Cleanup +lxc project delete user-5000 +userdel -r testuser 2>/dev/null || true + +# shellcheck disable=SC2034 +FAIL=0 From 8f97682e12a68a661391832a758e901811bf7fc6 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 4 Dec 2024 18:01:05 -0500 Subject: [PATCH 3/3] github: enable lxd-user test for 5.0 and newer Signed-off-by: Simon Deziel --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 130021b9..7f8fcc73 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,6 +94,7 @@ jobs: - devlxd-vm - docker - efi-vars-editor-vm + - lxd-user - interception - network-bridge-firewall - network-ovn @@ -129,6 +130,8 @@ jobs: track: "4.0/candidate" - test: efi-vars-editor-vm track: "4.0/candidate" + - test: lxd-user + track: "4.0/candidate" - test: network-bridge-firewall track: "4.0/candidate" os: 20.04 @@ -166,6 +169,8 @@ jobs: track: "4.0/edge" - test: efi-vars-editor-vm track: "4.0/edge" + - test: lxd-user + track: "4.0/edge" - test: network-bridge-firewall track: "4.0/edge" os: 20.04