From 65777f48d82dc3b5751ebae2ef7c490427cb27f4 Mon Sep 17 00:00:00 2001 From: hamistao Date: Fri, 6 Dec 2024 02:51:51 -0300 Subject: [PATCH] test: Improve attach/detach tests 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 --- test/suites/storage.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/suites/storage.sh b/test/suites/storage.sh index 723fd180af11..be8453aacc93 100644 --- a/test/suites/storage.sh +++ b/test/suites/storage.sh @@ -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