From d1481cde3fb7d490d95b314fc12a613fd4ee18eb Mon Sep 17 00:00:00 2001 From: Thomas Hipp Date: Fri, 18 Aug 2023 21:40:59 +0200 Subject: [PATCH] test: Use new `incus snapshot` commands Signed-off-by: Thomas Hipp --- test/suites/backup.sh | 30 ++++++------- test/suites/basic.sh | 2 +- test/suites/clustering.sh | 12 ++--- test/suites/config.sh | 6 +-- test/suites/container_devices_nic_bridged.sh | 6 +-- .../container_local_cross_pool_handling.sh | 9 ++-- test/suites/incremental_copy.sh | 6 +-- test/suites/migration.sh | 14 +++--- test/suites/projects.sh | 20 ++++----- test/suites/security.sh | 8 ++-- test/suites/snapshots.sh | 44 +++++++++---------- test/suites/storage_driver_btrfs.sh | 10 ++--- test/suites/storage_driver_zfs.sh | 8 ++-- 13 files changed, 87 insertions(+), 88 deletions(-) diff --git a/test/suites/backup.sh b/test/suites/backup.sh index bd35fd7664d..6d7a56db96c 100644 --- a/test/suites/backup.sh +++ b/test/suites/backup.sh @@ -103,7 +103,7 @@ EOF echo "hello world" | incus exec c1 --project test -- tee /mnt/test.txt incus exec c1 --project test -- grep -xF "hello world" /mnt/test.txt incus stop -f c1 - incus snapshot c1 + incus snapshot create c1 incus info c1 incus storage volume snapshot "${poolName}" vol1_test snap0 @@ -190,7 +190,7 @@ EOF incus exec c1 --project test -- grep -xF "hello world" /mnt/test.txt # Check snashot can be restored. - incus restore c1 snap0 + incus snapshot restore c1 snap0 incus info c1 incus exec c1 --project test -- hostname @@ -210,7 +210,7 @@ EOF incus info c1 | grep snap0 incus exec c1 --project test -- hostname - incus restore c1 snap0 + incus snapshot restore c1 snap0 incus info c1 incus exec c1 --project test -- hostname @@ -265,7 +265,7 @@ EOF incus info c1 | grep snap0 incus exec c1 --project test -- ls - incus restore c1 snap0 + incus snapshot restore c1 snap0 incus info c1 incus exec c1 --project test -- ls incus delete -f c1 @@ -366,7 +366,7 @@ test_backup_import_with_project() { incus launch testimage c1 incus launch testimage c2 - incus snapshot c2 + incus snapshot create c2 incus_backend=$(storage_backend "$INCUS_DIR") @@ -421,14 +421,14 @@ test_backup_import_with_project() { incus start c3 --project "$project-b" incus stop c2 --project "$project-b" --force incus stop c3 --project "$project-b" --force - incus restore c2 snap0 --project "$project-b" - incus restore c3 snap0 --project "$project-b" + incus snapshot restore c2 snap0 --project "$project-b" + incus snapshot restore c3 snap0 --project "$project-b" incus delete --force c2 --project "$project-b" incus delete --force c3 --project "$project-b" fi - incus restore c2 snap0 - incus restore c3 snap0 + incus snapshot restore c2 snap0 + incus snapshot restore c3 snap0 incus start c2 incus start c3 incus delete --force c2 @@ -444,8 +444,8 @@ test_backup_import_with_project() { incus start c3 incus stop c2 --force incus stop c3 --force - incus restore c2 snap0 - incus restore c3 snap0 + incus snapshot restore c2 snap0 + incus snapshot restore c3 snap0 incus start c2 incus start c3 incus delete --force c2 @@ -458,9 +458,9 @@ test_backup_import_with_project() { incus launch testimage c1-foo incus storage volume set "${default_pool}" container/c1-foo user.foo=c1-foo-snap0 - incus snapshot c1-foo c1-foo-snap0 + incus snapshot create c1-foo c1-foo-snap0 incus storage volume set "${default_pool}" container/c1-foo user.foo=c1-foo-snap1 - incus snapshot c1-foo c1-foo-snap1 + incus snapshot create c1-foo c1-foo-snap1 incus storage volume set "${default_pool}" container/c1-foo user.foo=post-c1-foo-snap1 incus export c1-foo "${INCUS_DIR}/c1-foo.tar.gz" @@ -543,7 +543,7 @@ test_backup_export_with_project() { ensure_has_localhost_remote "${INCUS_ADDR}" incus launch testimage c1 - incus snapshot c1 + incus snapshot create c1 mkdir "${INCUS_DIR}/optimized" "${INCUS_DIR}/non-optimized" incus_backend=$(storage_backend "$INCUS_DIR") @@ -593,7 +593,7 @@ test_backup_export_with_project() { # Check if hyphens cause issues when creating backups incus launch testimage c1-foo - incus snapshot c1-foo + incus snapshot create c1-foo incus export c1-foo "${INCUS_DIR}/c1-foo.tar.gz" diff --git a/test/suites/basic.sh b/test/suites/basic.sh index a20cc616576..282a65f5e1b 100644 --- a/test/suites/basic.sh +++ b/test/suites/basic.sh @@ -237,7 +237,7 @@ test_basic_usage() { ! incus init testimage aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || false # Test snapshot publish - incus snapshot bar + incus snapshot create bar incus publish bar/snap0 --alias foo incus init foo bar2 incus list | grep bar2 diff --git a/test/suites/clustering.sh b/test/suites/clustering.sh index fc93df7827f..02bfeb311aa 100644 --- a/test/suites/clustering.sh +++ b/test/suites/clustering.sh @@ -464,10 +464,10 @@ test_clustering_containers() { INCUS_DIR="${INCUS_ONE_DIR}" incus info --show-log foo | grep -q Log # Create, rename and delete a snapshot of the container via node1 - INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot foo foo-bak + INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot create foo foo-bak INCUS_DIR="${INCUS_ONE_DIR}" incus info foo | grep -q foo-bak - INCUS_DIR="${INCUS_ONE_DIR}" incus rename foo/foo-bak foo/foo-bak-2 - INCUS_DIR="${INCUS_ONE_DIR}" incus delete foo/foo-bak-2 + INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot rename foo/foo-bak foo/foo-bak-2 + INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot delete foo/foo-bak-2 ! INCUS_DIR="${INCUS_ONE_DIR}" incus info foo | grep -q foo-bak-2 || false # Export from node1 the image that was imported on node2 @@ -482,7 +482,7 @@ test_clustering_containers() { ! INCUS_DIR="${INCUS_TWO_DIR}" incus list | grep -q bar || false # Create a container on node1 using a snapshot from node2. - INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot foo foo-bak + INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot create foo foo-bak INCUS_DIR="${INCUS_TWO_DIR}" incus copy foo/foo-bak bar --target node1 INCUS_DIR="${INCUS_TWO_DIR}" incus info bar | grep -q "Location: node1" INCUS_DIR="${INCUS_THREE_DIR}" incus delete bar @@ -764,7 +764,7 @@ test_clustering_storage() { # Stop the container and create a snapshot INCUS_DIR="${INCUS_ONE_DIR}" incus stop foo --force - INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot foo snap-test + INCUS_DIR="${INCUS_ONE_DIR}" incus snapshot create foo snap-test # Move the container to node1 INCUS_DIR="${INCUS_TWO_DIR}" incus move foo --target node1 @@ -1394,7 +1394,7 @@ test_clustering_publish() { INCUS_DIR="${INCUS_ONE_DIR}" incus image show foo-image | grep -q "public: false" INCUS_DIR="${INCUS_TWO_DIR}" incus image delete foo-image - INCUS_DIR="${INCUS_TWO_DIR}" incus snapshot foo backup + INCUS_DIR="${INCUS_TWO_DIR}" incus snapshot create foo backup INCUS_DIR="${INCUS_ONE_DIR}" incus publish foo/backup --alias=foo-backup-image INCUS_DIR="${INCUS_ONE_DIR}" incus image show foo-backup-image | grep -q "public: false" diff --git a/test/suites/config.sh b/test/suites/config.sh index d6cc7f0e4fc..fc7943076ee 100644 --- a/test/suites/config.sh +++ b/test/suites/config.sh @@ -313,7 +313,7 @@ test_property() { incus config show foo | grep -q "ephemeral: false" # Create a snap of the instance to set its expiration timestamp - incus snapshot foo s1 + incus snapshot create foo s1 incus config set foo/s1 expires_at="2024-03-23T17:38:37.753398689-04:00" --property incus config show foo/s1 | grep -q "expires_at: 2024-03-23T17:38:37.753398689-04:00" incus config unset foo/s1 expires_at --property @@ -349,7 +349,7 @@ test_config_edit_container_snapshot_pool_config() { ensure_import_testimage incus init testimage c1 -s "$storage_pool" - incus snapshot c1 s1 + incus snapshot create c1 s1 # edit the container volume name incus storage volume show "$storage_pool" container/c1 | \ sed 's/^description:.*/description: bar/' | \ @@ -404,7 +404,7 @@ test_container_snapshot_config() { ensure_import_testimage incus init testimage foo -s "incustest-$(basename "${INCUS_DIR}")" - incus snapshot foo + incus snapshot create foo incus config show foo/snap0 | grep -q 'expires_at: 0001-01-01T00:00:00Z' echo 'expires_at: 2100-01-01T00:00:00Z' | incus config edit foo/snap0 diff --git a/test/suites/container_devices_nic_bridged.sh b/test/suites/container_devices_nic_bridged.sh index f537104e03c..944fb43d6fc 100644 --- a/test/suites/container_devices_nic_bridged.sh +++ b/test/suites/container_devices_nic_bridged.sh @@ -584,7 +584,7 @@ test_container_devices_nic_bridged() { grep -F "192.0.2.232" "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/${ctName}.eth0" incus copy "${ctName}" foo # Gets new MAC address but IPs still conflict. ! stat "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/foo.eth0" || false - incus snapshot foo + incus snapshot create foo incus export foo foo.tar.gz ! incus start foo || false incus config device set foo eth0 \ @@ -595,7 +595,7 @@ test_container_devices_nic_bridged() { incus stop -f foo # Test container snapshot with conflicting addresses can be restored. - incus restore foo snap0 # Test restore, IPs conflict on config device update (due to only IPs changing). + incus snapshot restore foo snap0 # Test restore, IPs conflict on config device update (due to only IPs changing). ! stat "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/foo.eth0" || false # Check lease file removed (due to non-user requested update failing). incus config device get foo eth0 ipv4.address | grep -Fx '192.0.2.232' ! incus start foo || false @@ -606,7 +606,7 @@ test_container_devices_nic_bridged() { incus start foo incus stop -f foo - incus restore foo snap0 # Test restore, IPs conflict on config device remove/add (due to MAC change). + incus snapshot restore foo snap0 # Test restore, IPs conflict on config device remove/add (due to MAC change). ! stat "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/foo.eth0" || false # Check lease file removed (due to MAC change). incus config device get foo eth0 ipv4.address | grep -Fx '192.0.2.232' ! incus start foo || false diff --git a/test/suites/container_local_cross_pool_handling.sh b/test/suites/container_local_cross_pool_handling.sh index 1be5014a686..5cd84bc220a 100644 --- a/test/suites/container_local_cross_pool_handling.sh +++ b/test/suites/container_local_cross_pool_handling.sh @@ -86,8 +86,8 @@ test_container_local_cross_pool_handling() { incus delete -f c2 incus init testimage c1 - incus snapshot c1 - incus snapshot c1 + incus snapshot create c1 + incus snapshot create c1 incus copy c1 c2 -s "incustest-$(basename "${INCUS_DIR}")-${driver}1" --instance-only incus storage volume show "incustest-$(basename "${INCUS_DIR}")-${driver}1" container/c2 ! incus storage volume show "incustest-$(basename "${INCUS_DIR}")-${driver}1" container/c2/snap0 || false @@ -101,8 +101,8 @@ test_container_local_cross_pool_handling() { incus delete -f c2 incus init testimage c1 - incus snapshot c1 - incus snapshot c1 + incus snapshot create c1 + incus snapshot create c1 incus copy c1 c2 -s "incustest-$(basename "${INCUS_DIR}")-${driver}1" incus storage volume show "incustest-$(basename "${INCUS_DIR}")-${driver}1" container/c2 incus storage volume show "incustest-$(basename "${INCUS_DIR}")-${driver}1" container/c2/snap0 @@ -124,4 +124,3 @@ test_container_local_cross_pool_handling() { INCUS_DIR="${INCUS_DIR}" kill_incus "${INCUS_STORAGE_DIR}" } - diff --git a/test/suites/incremental_copy.sh b/test/suites/incremental_copy.sh index 868ede31913..dd6848128be 100644 --- a/test/suites/incremental_copy.sh +++ b/test/suites/incremental_copy.sh @@ -64,9 +64,9 @@ do_copy() { # This will create snapshot c1/snap0 incus storage volume set "${source_pool}" container/c1 user.foo=snap0 - incus snapshot c1 + incus snapshot create c1 incus storage volume set "${source_pool}" container/c1 user.foo=snap1 - incus snapshot c1 + incus snapshot create c1 incus storage volume set "${source_pool}" container/c1 user.foo=main # Remove the testfile from c1 and refresh again @@ -88,7 +88,7 @@ do_copy() { incus storage volume get "${target_pool}" container/c2/snap1 user.foo | grep -Fx "snap1" # This will create snapshot c2/snap2 - incus snapshot c2 + incus snapshot create c2 incus config show c2/snap2 incus storage volume show "${target_pool}" container/c2/snap2 diff --git a/test/suites/migration.sh b/test/suites/migration.sh index f20f6938af1..c5c61e6de7d 100644 --- a/test/suites/migration.sh +++ b/test/suites/migration.sh @@ -178,9 +178,9 @@ migration() { incus storage volume set "${pool}" container/cccp user.foo=snap0 echo "before" | incus file push - cccp/blah - incus snapshot cccp + incus snapshot create cccp incus storage volume set "${pool}" container/cccp user.foo=snap1 - incus snapshot cccp + incus snapshot create cccp echo "after" | incus file push - cccp/blah incus storage volume set "${pool}" container/cccp user.foo=postsnap1 @@ -238,8 +238,8 @@ migration() { # Test container only copies incus init testimage cccp - incus snapshot cccp - incus snapshot cccp + incus snapshot create cccp + incus snapshot create cccp # Local container with snapshots move. incus move cccp udssr --mode=pull @@ -251,8 +251,8 @@ migration() { # Test container only copies when zfs.clone_copy is set to false. incus storage set "incustest-$(basename "${INCUS_DIR}")" zfs.clone_copy false incus init testimage cccp - incus snapshot cccp - incus snapshot cccp + incus snapshot create cccp + incus snapshot create cccp # Test container only copies when zfs.clone_copy is set to false. incus copy cccp udssr --instance-only @@ -558,7 +558,7 @@ migration() { # On zfs, this used to crash due to a websocket read issue. incus launch testimage c1 - incus snapshot c1 + incus snapshot create c1 incus copy c1 l2:c1 --stateless incus copy c1 l2:c1 --stateless --refresh diff --git a/test/suites/projects.sh b/test/suites/projects.sh index c3570c0c9d7..a39220df230 100644 --- a/test/suites/projects.sh +++ b/test/suites/projects.sh @@ -202,26 +202,26 @@ test_projects_snapshots() { incus init testimage c1 # Create, rename, restore and delete a snapshot - incus snapshot c1 + incus snapshot create c1 incus info c1 | grep -q snap0 incus config show c1/snap0 | grep -q BusyBox - incus rename c1/snap0 c1/foo - incus restore c1 foo - incus delete c1/foo + incus snapshot rename c1/snap0 c1/foo + incus snapshot restore c1 foo + incus snapshot delete c1/foo # Test copies - incus snapshot c1 - incus snapshot c1 + incus snapshot create c1 + incus snapshot create c1 incus copy c1 c2 incus delete c2 # Create a snapshot in this project and another one in the default project - incus snapshot c1 + incus snapshot create c1 incus project switch default ensure_import_testimage incus init testimage c1 - incus snapshot c1 + incus snapshot create c1 incus delete c1 # Switch back to the project @@ -578,8 +578,8 @@ test_projects_limits() { incus project set p1 limits.memory 3GiB # Validate that snapshots don't fail with limits. - incus snapshot c2 - incus restore c2 snap0 + incus snapshot create c2 + incus snapshot restore c2 snap0 incus delete c2 diff --git a/test/suites/security.sh b/test/suites/security.sh index 9d52369a96e..49beaf12be5 100644 --- a/test/suites/security.sh +++ b/test/suites/security.sh @@ -149,14 +149,14 @@ test_security_protection() { # Test deletion protecton incus init testimage c1 - incus snapshot c1 + incus snapshot create c1 incus delete c1 incus profile set default security.protection.delete true incus init testimage c1 - incus snapshot c1 - incus delete c1/snap0 + incus snapshot create c1 + incus snapshot delete c1/snap0 ! incus delete c1 || false incus config set c1 security.protection.delete false @@ -184,7 +184,7 @@ test_security_protection() { incus publish c1 --alias=protected incus image delete protected - incus snapshot c1 + incus snapshot create c1 incus publish c1/snap0 --alias=protected incus image delete protected diff --git a/test/suites/snapshots.sh b/test/suites/snapshots.sh index d91411cddef..babda86043b 100644 --- a/test/suites/snapshots.sh +++ b/test/suites/snapshots.sh @@ -24,19 +24,19 @@ snapshots() { incus init testimage foo - incus snapshot foo + incus snapshot create foo # FIXME: make this backend agnostic if [ "$incus_backend" = "dir" ]; then [ -d "${INCUS_DIR}/snapshots/foo/snap0" ] fi - incus snapshot foo + incus snapshot create foo # FIXME: make this backend agnostic if [ "$incus_backend" = "dir" ]; then [ -d "${INCUS_DIR}/snapshots/foo/snap1" ] fi - incus snapshot foo tester + incus snapshot create foo tester # FIXME: make this backend agnostic if [ "$incus_backend" = "dir" ]; then [ -d "${INCUS_DIR}/snapshots/foo/tester" ] @@ -48,16 +48,16 @@ snapshots() { [ -d "${INCUS_DIR}/containers/foosnap1/rootfs" ] fi - incus delete foo/snap0 + incus snapshot delete foo/snap0 # FIXME: make this backend agnostic if [ "$incus_backend" = "dir" ]; then [ ! -d "${INCUS_DIR}/snapshots/foo/snap0" ] fi # test deleting multiple snapshots - incus snapshot foo snap2 - incus snapshot foo snap3 - incus delete foo/snap2 foo/snap3 + incus snapshot create foo snap2 + incus snapshot create foo snap3 + incus snapshot delete foo/snap2 foo/snap3 ! incus info foo | grep -q snap2 || false ! incus info foo | grep -q snap3 || false @@ -69,13 +69,13 @@ snapshots() { fi incus move foo/tester2 foo/tester-two - incus delete foo/tester-two + incus snapshot delete foo/tester-two # FIXME: make this backend agnostic if [ "$incus_backend" = "dir" ]; then [ ! -d "${INCUS_DIR}/snapshots/foo/tester-two" ] fi - incus snapshot foo namechange + incus snapshot create foo namechange # FIXME: make this backend agnostic if [ "$incus_backend" = "dir" ]; then [ -d "${INCUS_DIR}/snapshots/foo/namechange" ] @@ -145,7 +145,7 @@ snap_restore() { incus storage set "${pool}" volume.block.filesystem=xfs fi - incus snapshot bar snap0 + incus snapshot create bar snap0 ## prepare snap1 incus start bar @@ -168,7 +168,7 @@ snap_restore() { incus config set bar limits.cpu 1 - incus snapshot bar snap1 + incus snapshot create bar snap1 incus storage volume set "${pool}" container/bar user.foo=postsnaps # Check volume.block.filesystem on storage volume in parent and snapshot match. @@ -230,7 +230,7 @@ snap_restore() { initialUUID=$(incus config get bar volatile.uuid) initialGenerationID=$(incus config get bar volatile.uuid.generation) incus start bar - incus snapshot bar snap2 --stateful + incus snapshot create bar snap2 --stateful restore_and_compare_fs snap2 newUUID=$(incus config get bar volatile.uuid) @@ -293,10 +293,10 @@ snap_restore() { # Test if container's with hyphen's in their names are treated correctly. incus launch testimage a-b - incus snapshot a-b base - incus restore a-b base - incus snapshot a-b c-d - incus restore a-b c-d + incus snapshot create a-b base + incus snapshot restore a-b base + incus snapshot create a-b c-d + incus snapshot restore a-b c-d incus delete -f a-b } @@ -304,7 +304,7 @@ restore_and_compare_fs() { snap=${1} echo "==> Restoring ${snap}" - incus restore bar "${snap}" + incus snapshot restore bar "${snap}" # FIXME: make this backend agnostic if [ "$(storage_backend "$INCUS_DIR")" = "dir" ]; then @@ -322,17 +322,17 @@ test_snap_expiry() { ensure_has_localhost_remote "${INCUS_ADDR}" incus launch testimage c1 - incus snapshot c1 + incus snapshot create c1 incus config show c1/snap0 | grep -q 'expires_at: 0001-01-01T00:00:00Z' incus config set c1 snapshots.expiry '1d' - incus snapshot c1 + incus snapshot create c1 ! incus config show c1/snap1 | grep -q 'expires_at: 0001-01-01T00:00:00Z' || false incus copy c1 c2 ! incus config show c2/snap1 | grep -q 'expires_at: 0001-01-01T00:00:00Z' || false - incus snapshot c1 --no-expiry + incus snapshot create c1 --no-expiry incus config show c1/snap2 | grep -q 'expires_at: 0001-01-01T00:00:00Z' || false incus rm -f c1 @@ -377,8 +377,8 @@ test_snap_volume_db_recovery() { poolName=$(incus profile device get default root pool) incus init testimage c1 - incus snapshot c1 - incus snapshot c1 + incus snapshot create c1 + incus snapshot create c1 incus start c1 incus stop -f c1 incusd sql global 'DELETE FROM storage_volumes_snapshots' # Remove volume snapshot DB records. diff --git a/test/suites/storage_driver_btrfs.sh b/test/suites/storage_driver_btrfs.sh index 2dbfa2e73c8..1650ed27ea7 100644 --- a/test/suites/storage_driver_btrfs.sh +++ b/test/suites/storage_driver_btrfs.sh @@ -30,7 +30,7 @@ test_storage_driver_btrfs() { incus launch testimage c1pool1 -s "incustest-$(basename "${INCUS_DIR}")-pool1" # Snapshot without any subvolumes (to test missing subvolume parent origin is handled). - incus snapshot c1pool1 snap0 + incus snapshot create c1pool1 snap0 # Create some subvolumes and populate with test files. Mark the intermedia subvolume as read only. OWNER="$(stat -c %u:%g "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs")" @@ -46,7 +46,7 @@ test_storage_driver_btrfs() { btrfs property set "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs/a/b" ro true # Snapshot again now subvolumes exist. - incus snapshot c1pool1 snap1 + incus snapshot create c1pool1 snap1 # Add some more files to subvolumes btrfs property set "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs/a/b" ro false @@ -54,7 +54,7 @@ test_storage_driver_btrfs() { incus exec c1pool1 -- touch /a/b/b2.txt incus exec c1pool1 -- touch /a/b/c/c2.txt btrfs property set "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs/a/b" ro true - incus snapshot c1pool1 snap2 + incus snapshot create c1pool1 snap2 # Copy container to other BTRFS storage pool (will use migration subsystem). incus copy c1pool1 c1pool2 -s "incustest-$(basename "${INCUS_DIR}")-pool2" @@ -69,7 +69,7 @@ test_storage_driver_btrfs() { incus exec c1pool2 -- touch /a/b/c/w.txt # Restore copied snapshot and check it is correct. - incus restore c1pool2 snap1 + incus snapshot restore c1pool2 snap1 incus exec c1pool2 -- stat /a/a1.txt incus exec c1pool2 -- stat /a/b/b1.txt incus exec c1pool2 -- stat /a/b/c/c1.txt @@ -104,7 +104,7 @@ test_storage_driver_btrfs() { btrfs subvol delete "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs/a/b/c" btrfs subvol delete "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs/a/b" btrfs subvol delete "${INCUS_DIR}/storage-pools/incustest-$(basename "${INCUS_DIR}")-pool1/containers/c1pool1/rootfs/a" - incus restore c1pool1 snap1 + incus snapshot restore c1pool1 snap1 incus exec c1pool1 -- stat /a/a1.txt incus exec c1pool1 -- stat /a/b/b1.txt incus exec c1pool1 -- stat /a/b/c/c1.txt diff --git a/test/suites/storage_driver_zfs.sh b/test/suites/storage_driver_zfs.sh index d3745833a22..56a9474c8a9 100644 --- a/test/suites/storage_driver_zfs.sh +++ b/test/suites/storage_driver_zfs.sh @@ -156,7 +156,7 @@ do_storage_driver_zfs() { incus rename c2 c3 # Create snapshot - incus snapshot c3 snap0 + incus snapshot create c3 snap0 [ "$(zfs get -H -o value type incustest-"$(basename "${INCUS_DIR}")/containers/c3@snapshot-snap0")" = "snapshot" ] # This should create c11 as a dataset, and c21 as a zvol @@ -198,7 +198,7 @@ do_storage_driver_zfs() { [ "$(zfs get -H -o value type incustest-"$(basename "${INCUS_DIR}")/containers/c4")" = "volume" ] incus exec c4 -- touch /root/foo incus stop -f c4 - incus snapshot c4 snap0 + incus snapshot create c4 snap0 incus export c4 "${INCUS_DIR}/c4.tar.gz" incus rm -f c4 @@ -209,10 +209,10 @@ do_storage_driver_zfs() { incus exec c4 -- test -f /root/foo # Snapshot and restore - incus snapshot c4 snap1 + incus snapshot create c4 snap1 incus exec c4 -- touch /root/bar incus stop -f c4 - incus restore c4 snap1 + incus snapshot restore c4 snap1 incus start c4 incus exec c4 -- test -f /root/foo ! incus exec c4 -- test -f /root/bar || false