Skip to content

Commit

Permalink
tests/lxd-user: test lxd-user daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Dec 4, 2024
1 parent 7e7d301 commit 362ee83
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/lxd-user
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 362ee83

Please sign in to comment.