Skip to content

Commit

Permalink
test/suites: Ensure restricted clients can list inherited resources.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Laing <[email protected]>
  • Loading branch information
markylaing committed Feb 21, 2024
1 parent b62c8b5 commit 40d791b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/suites/tls_restrictions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,36 @@ test_tls_restrictions() {

! lxc_remote project create localhost:blah1 || false

# Ensure we can create and view resources that are not enabled for the project (e.g. their effective project is
# the default project).

# Networks are disabled when projects are created.
lxc_remote network create localhost:blah-network --project blah
lxc_remote network show localhost:blah-network --project blah
lxc_remote network list localhost: --project blah | grep blah-network
lxc_remote network rm localhost:blah-network --project blah

# Network zones are disabled when projects are created.
lxc_remote network zone create localhost:blah-zone --project blah
lxc_remote network zone show localhost:blah-zone --project blah
lxc_remote network zone list localhost: --project blah | grep blah-zone
lxc_remote network zone delete localhost:blah-zone --project blah

# Unset the profiles feature (the default is false).
lxc project unset blah features.profiles
lxc_remote profile create localhost:blah-profile --project blah
lxc_remote profile show localhost:blah-profile --project blah
lxc_remote profile list localhost: --project blah | grep blah-profile
lxc_remote profile delete localhost:blah-profile --project blah

# Unset the storage volumes feature (the default is false).
lxc project unset blah features.storage.volumes
lxc_remote storage volume create "localhost:${pool_name}" blah-volume --project blah
lxc_remote storage volume show "localhost:${pool_name}" blah-volume --project blah
lxc_remote storage volume list "localhost:${pool_name}" --project blah
lxc_remote storage volume list "localhost:${pool_name}" --project blah | grep blah-volume
lxc_remote storage volume delete "localhost:${pool_name}" blah-volume --project blah

# Cleanup
lxc config trust show "${FINGERPRINT}" | sed -e "s/restricted: true/restricted: false/" | lxc config trust edit "${FINGERPRINT}"
lxc project delete blah
Expand Down

0 comments on commit 40d791b

Please sign in to comment.