[lxc-devel] [lxd/master] test: Adds tests for copying instance with snapshots containing invalid disk devices

tomponline on Github lxc-bot at linuxcontainers.org
Thu Nov 26 16:01:23 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201126/903629ce/attachment.bin>
-------------- next part --------------
From de1a496c6ba1dcef90b540259ba8fb63b5a9edc4 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Thu, 26 Nov 2020 15:59:52 +0000
Subject: [PATCH] test/suites/migration: Adds tests for copying instance with
 snapshots containing invalid disk devices

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 test/suites/migration.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/test/suites/migration.sh b/test/suites/migration.sh
index f2416eed6b..2e7c3bc5e0 100644
--- a/test/suites/migration.sh
+++ b/test/suites/migration.sh
@@ -368,6 +368,25 @@ migration() {
   lxc_remote project switch l1:default
   lxc_remote project delete l1:proj
 
+
+  # Check migration with invalid snapshot config (disks attached with missing source pool and source path).
+  lxc_remote init testimage l1:c1
+  lxc_remote storage create l1:dir dir
+  lxc_remote storage volume create l1:dir vol1
+  lxc_remote storage volume attach l1:dir vol1 c1 /mnt
+  mkdir "$LXD_DIR/testvol2"
+  lxc_remote config device add l1:c1 vol2 disk source="$LXD_DIR/testvol2" path=/vol2
+  lxc_remote snapshot l1:c1 # Take snapshot with disk devices still attached.
+  lxc_remote config device remove c1 vol1
+  lxc_remote config device remove c1 vol2
+  rmdir "$LXD_DIR/testvol2"
+  lxc_remote copy l1:c1 l2:
+  lxc_remote info l2:c1 | grep snap0
+  lxc_remote delete l1:c1 -f
+  lxc_remote delete l2:c1 -f
+  lxc_remote storage volume delete l1:dir vol1
+  lxc_remote storage delete l1:dir
+
   if ! which criu >/dev/null 2>&1; then
     echo "==> SKIP: live migration with CRIU (missing binary)"
     return


More information about the lxc-devel mailing list