Skip to content

Commit

Permalink
test: Improve attach/detach tests
Browse files Browse the repository at this point in the history
This checks the device entry on `lxc config show`, checks that the entry
is gone after detaching and tests detaching with the full volume name,
e.g. custom/c1pool1.

Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Dec 10, 2024
1 parent bfa0c62 commit 2ef5355
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/suites/storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,12 @@ EOF
lxc storage volume set "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 zfs.use_refquota true
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice /opt
! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice2 /opt || false
lxc config show c1pool1 | grep -Pz " testDevice:\n path: /opt\n pool: lxdtest-$(basename "${LXD_DIR}")-pool1\n source: c1pool1\n type: disk\n"
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1
! lxc config show c1pool1 | grep "testDevice" || false
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice /opt
! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1

lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice /opt
Expand Down

0 comments on commit 2ef5355

Please sign in to comment.