Skip to content

Commit

Permalink
test/suites: Add testing for project PATCH
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Bolton <[email protected]>
  • Loading branch information
boltmark committed Jul 19, 2024
1 parent fa5eb8a commit b44b461
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/suites/projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ test_projects_crud() {
lxc project show foo | grep -q 'features.images: "true"'
lxc project get foo "features.profiles" | grep -q 'true'

# Set a limit
lxc project set foo limits.containers 10
lxc project show foo | grep -q 'limits.containers: "10"'

# Trying to create a project with the same name fails
! lxc project create foo || false

Expand All @@ -37,6 +41,13 @@ test_projects_crud() {
lxc project show bar| sed 's/^description:.*/description: "Bar project"/' | lxc project edit bar
lxc project show bar | grep -q "description: Bar project"

# Edit the project config via PATCH. Existing key/value pairs should remain or be updated.
lxc query -X PATCH -d '{\"config\" : {\"limits.memory\":\"5GiB\",\"features.images\":\"false\"}}' /1.0/projects/bar
lxc project show bar | grep -q 'limits.memory: 5GiB'
lxc project show bar | grep -q 'features.images: "false"'
lxc project show bar | grep -q 'features.profiles: "true"'
lxc project show bar | grep -q 'limits.containers: "10"'

# Create a second project
lxc project create foo

Expand Down

0 comments on commit b44b461

Please sign in to comment.