-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/lxd-user: test lxd-user daemon
Signed-off-by: Simon Deziel <[email protected]>
- Loading branch information
1 parent
7e7d301
commit 362ee83
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |