Skip to content

Commit

Permalink
test: Add profile creation test with YAML
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
  • Loading branch information
gabrielmougard committed Aug 2, 2024
1 parent 915315f commit 7042c35
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/suites/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,30 @@ test_basic_usage() {
lxc profile delete foo
lxc delete -f c1

# Test assigning a profile through a YAML file to an instance.
poolName=$(lxc profile device get default root pool)
cat > "test_profile.yaml" << EOF
config:
limits.cpu: "2"
limits.memory: 1024MB
description: Test profile
devices:
root:
path: /
pool: ${poolName}
type: disk
EOF

lxc profile create foo < test_profile.yaml
lxc init testimage c1
lxc profile assign c1 foo
lxc config show c1 | grep -q "limits.cpu: \"2\""
lxc config show c1 | grep -q "limits.memory: 1024MB"
lxc config show c1 | grep -q "description: Test profile"
lxc delete -f c1
lxc profile delete foo
rm "test_profile.yaml"

# Multiple ephemeral instances delete
lxc launch testimage c1
lxc launch testimage c2
Expand Down

0 comments on commit 7042c35

Please sign in to comment.