-
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.
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 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
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
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 |