File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,43 @@ load helpers.bash
6363 [[ " $output " =~ " Storage validation failed" ]]
6464}
6565
66+ @test " Advanced --roStoragePath directory is initialized" {
67+ # Populate the storage dir with a dummy file
68+ # This way the directory is neither empty or with a store structure
69+ touch " $RO_STORAGE /dummy-file"
70+
71+ run " $PARALLAX_BINARY " \
72+ --podmanRoot " $PODMAN_ROOT " \
73+ --roStoragePath " $RO_STORAGE " \
74+ --mksquashfsPath " $MKSQUASHFS_PATH " \
75+ --log-level info \
76+ --migrate \
77+ --image alpine:latest
78+
79+ # Expect a non-zero exit code and a validation error
80+ [ " $status " -ne 0 ]
81+ [[ " $output " =~ " Storage validation failed" ]]
82+
83+ # Bootstrap RO_STORAGE with a pulled image, this satisfies the dir structure validation
84+ run " $PODMAN_BINARY " \
85+ --root " $RO_STORAGE " \
86+ --runroot " $PODMAN_RUNROOT " \
87+ pull alpine:latest
88+ [ " $status " -eq 0 ]
89+
90+ # Now migration should pass
91+ run " $PARALLAX_BINARY " \
92+ --podmanRoot " $PODMAN_ROOT " \
93+ --roStoragePath " $RO_STORAGE " \
94+ --mksquashfsPath " $MKSQUASHFS_PATH " \
95+ --log-level info \
96+ --migrate \
97+ --image alpine:latest
98+
99+ [ " $status " -eq 0 ]
100+ [[ " $output " =~ " Migration successfully completed" ]]
101+ }
102+
66103@test " Fails RMI when --roStoragePath directory is non-empty" {
67104 # Populate the storage dir with a dummy file
68105 # This way the directory is neither empty or with a store structure
You can’t perform that action at this time.
0 commit comments