Skip to content

Commit

Permalink
tests: Add tests for handling devices with long names
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Jun 2, 2024
1 parent bef17e4 commit e2af9b8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/storage-disks-vm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ waitInstanceReady v1
lxc exec v1 -- ls -l /mnt/foo1
lxc stop -f v1

# Check adding a disk to a vm with a long name to test possible problems with long socket paths or long qemu device tags
LONG_DEVICE_NAME="device-with-very-long-name-for-long-qemu-property-handling-tests"

lxc init "${IMAGE}" v2 --vm
lxc config device add v2 "${LONG_DEVICE_NAME}" disk source="${testRoot}/allowed1" path="/mnt"
lxc start v2
waitInstanceReady v2
lxc config device remove v2 "${LONG_DEVICE_NAME}"
lxc config device add v2 "${LONG_DEVICE_NAME}" disk source="${testRoot}/allowed1" path="/mnt" # Test hotplugging as well
lxc exec v2 -- ls -l /mnt
lxc delete -f v2

# Check adding a disk with a source path that is allowed that symlinks to another allowed source path isn't
# allowed at start time.
lxc config device set v1 d1 source="${testRoot}/allowed1/not-allowed2"
Expand Down

0 comments on commit e2af9b8

Please sign in to comment.