Skip to content

Commit

Permalink
tests: Add test for setting initial owner of a cutom volume
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Resztak <[email protected]>
  • Loading branch information
presztak committed Nov 24, 2024
1 parent 170502f commit bd9e372
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/suites/storage_volume_initial_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,26 @@ test_storage_volume_initial_config() {
incus delete c --force
fi

# Test initial owner of a custom volume configuration options.
incus storage volume create "${pool}" testvolume1
incus storage volume create "${pool}" testvolume2 initial.uid=101 initial.gid=101 initial.mode=0700

incus launch testimage c1

incus storage volume attach "${pool}" testvolume1 c1 /testvolume1
incus storage volume attach "${pool}" testvolume2 c1 /testvolume2

[ "$(incus exec c1 -- stat -c %u:%g /testvolume1 )" = "0:0" ]
[ "$(incus exec c1 -- stat -c %a /testvolume1 )" = "711" ]
[ "$(incus exec c1 -- stat -c %u:%g /testvolume2 )" = "101:101" ]
[ "$(incus exec c1 -- stat -c %a /testvolume2 )" = "700" ]

incus storage volume detach "${pool}" testvolume1 c1
incus storage volume detach "${pool}" testvolume2 c1

incus storage volume delete "${pool}" testvolume1
incus storage volume delete "${pool}" testvolume2

# Cleanup
incus profile delete "${profile}"

Expand Down

0 comments on commit bd9e372

Please sign in to comment.