Skip to content

Commit 301a297

Browse files
committed
tests: Update copy with refresh test
Update the copy custom volume test (with refresh flag) after resolving the issue related to the missing CreationDate for a copied custom volume. Signed-off-by: Piotr Resztak <[email protected]>
1 parent 6f41223 commit 301a297

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

test/suites/storage_local_volume_handling.sh

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -219,40 +219,32 @@ test_storage_local_volume_handling() {
219219
incus storage volume snapshot create "${source_pool}" vol5
220220
incus storage volume set "${source_pool}" vol5 user.foo=snap1vol5
221221
incus storage volume snapshot create "${source_pool}" vol5
222-
incus storage volume set "${source_pool}" vol5 user.foo=snapremovevol5
223-
incus storage volume snapshot create "${source_pool}" vol5 snapremove
224222
incus storage volume set "${source_pool}" vol5 user.foo=postsnap1vol5
225223

226-
# create storage volume with user config differing over snapshots and additional snapshot than vol5
227-
incus storage volume create "${source_pool}" vol6 --type=block size=4194304
228-
incus storage volume set "${source_pool}" vol6 user.foo=snap0vol6
229-
incus storage volume snapshot create "${source_pool}" vol6
230-
incus storage volume set "${source_pool}" vol6 user.foo=snap1vol6
231-
incus storage volume snapshot create "${source_pool}" vol6
232-
incus storage volume set "${source_pool}" vol6 user.foo=snap2vol6
233-
incus storage volume snapshot create "${source_pool}" vol6
234-
incus storage volume set "${source_pool}" vol6 user.foo=postsnap1vol6
235-
236224
# copy to new volume destination with refresh flag
237225
incus storage volume copy --refresh "${source_pool}/vol5" "${target_pool}/vol5"
238226

239227
# check snapshot volumes (including config) were copied
240228
incus storage volume get "${target_pool}" vol5 user.foo | grep -Fx "postsnap1vol5"
241229
incus storage volume get "${target_pool}" vol5/snap0 user.foo | grep -Fx "snap0vol5"
242230
incus storage volume get "${target_pool}" vol5/snap1 user.foo | grep -Fx "snap1vol5"
243-
incus storage volume get "${target_pool}" vol5/snapremove user.foo | grep -Fx "snapremovevol5"
231+
232+
# create additional snapshot on source_pool and one on target_pool
233+
incus storage volume snapshot create "${source_pool}" vol5 postsnap1vol5
234+
incus storage volume set "${target_pool}" vol5 user.foo=snapremovevol5
235+
incus storage volume snapshot create "${target_pool}" vol5 snapremove
244236

245237
# incremental copy to existing volume destination with refresh flag
246-
incus storage volume copy --refresh "${source_pool}/vol6" "${target_pool}/vol5"
238+
incus storage volume copy --refresh "${source_pool}/vol5" "${target_pool}/vol5"
247239

248240
# check snapshot volumes (including config) was overridden from new source and that missing snapshot is
249241
# present and that the missing snapshot has been removed.
250-
# Note: Due to a known issue we are currently only diffing the snapshots by name, so infact existing
251-
# snapshots of the same name won't be overwritten even if their config or contents is different.
252-
incus storage volume get "${target_pool}" vol5 user.foo | grep -Fx "postsnap1vol5"
242+
# Note: We are currently diffing the snapshots by name and creation date, so infact existing
243+
# snapshots of the same name and cretion date won't be overwritten even if their config or contents is different.
244+
incus storage volume get "${target_pool}" vol5 user.foo | grep -Fx "snapremovevol5"
253245
incus storage volume get "${target_pool}" vol5/snap0 user.foo | grep -Fx "snap0vol5"
254246
incus storage volume get "${target_pool}" vol5/snap1 user.foo | grep -Fx "snap1vol5"
255-
incus storage volume get "${target_pool}" vol5/snap2 user.foo | grep -Fx "snap2vol6"
247+
incus storage volume get "${target_pool}" vol5/postsnap1vol5 user.foo | grep -Fx "postsnap1vol5"
256248
! incus storage volume get "${target_pool}" vol5/snapremove user.foo || false
257249

258250
# copy ISO custom volumes
@@ -272,7 +264,6 @@ test_storage_local_volume_handling() {
272264
incus storage volume delete "${target_pool}" vol4
273265
incus storage volume delete "${source_pool}" vol5
274266
incus storage volume delete "${target_pool}" vol5
275-
incus storage volume delete "${source_pool}" vol6
276267
incus storage volume delete "${target_pool}" iso1
277268
incus storage volume delete "${target_pool}" iso2
278269
rm -f foo.iso

0 commit comments

Comments
 (0)