File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ if [ "${1:-"all"}" != "cluster" ]; then
296
296
run_test test_image_auto_update " image auto-update"
297
297
run_test test_image_prefer_cached " image prefer cached"
298
298
run_test test_image_import_dir " import image from directory"
299
+ run_test test_image_import_with_reuse " import image with reuse flag"
299
300
run_test test_image_refresh " image refresh"
300
301
run_test test_image_acl " image acl"
301
302
run_test test_cloud_init " cloud-init"
Original file line number Diff line number Diff line change @@ -122,6 +122,22 @@ test_image_import_existing_alias() {
122
122
incus image delete newimage image2
123
123
}
124
124
125
+ test_image_import_with_reuse () {
126
+ ensure_import_testimage
127
+ incus init testimage c
128
+ fingerprint=" $( incus publish c --alias image1 | awk ' {print $NF;}' ) "
129
+ incus delete c
130
+ incus image export image1 image1.file
131
+ incus image delete image1
132
+
133
+ incus image import image1.file.tar.gz --alias testimage --reuse
134
+
135
+ [ " $( incus image ls -c F -f csv testimage) " = " ${fingerprint} " ]
136
+ [ " $( incus image ls -f csv | wc -l) " = " 1" ]
137
+
138
+ incus image delete testimage
139
+ }
140
+
125
141
test_image_refresh () {
126
142
# shellcheck disable=2039,3043
127
143
local INCUS2_DIR INCUS2_ADDR
You can’t perform that action at this time.
0 commit comments