Skip to content

Commit 45b16fa

Browse files
committed
Add further unit tests for check rootfs format of bunnyfile
Add further unit tests for checking the unsupported features that a rootfs field implies in a bunnyfile. In particular add the following tests: - Non-empty path with raw rootfs type, which means that we specify both a file to use as rootfs but also set the type as raw, which will require to unpack the file and transform it to raw. This is not supported yet. - The from field equals "local" and the rootfs type is raw, which means that we have to use something local as raw, which is similar to the previous case (use a file with raw rootfs type). Again not supported yet. - The from field is not scratch and we the include field is non-empty, which means that we want to append files in an existing rootds. This is not supported yet. Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
1 parent 8a569b1 commit 45b16fa

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

hops/validate_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,24 @@ func TestValidateBunnyfileRootfs(t *testing.T) {
166166
expectError: true,
167167
errorText: "The from field of rootfs can not be empty",
168168
},
169+
{
170+
name: "Invalid non-empty path, type raw",
171+
input: "local/path/raw/",
172+
expectError: true,
173+
errorText: "The path field in rootfs can not be combined",
174+
},
175+
{
176+
name: "Invalid from local with type raw",
177+
input: "local//raw/",
178+
expectError: true,
179+
errorText: "If type of rootfs is raw, then from can not",
180+
},
181+
{
182+
name: "Invalid from local with includes",
183+
input: "local/path//foo:bar",
184+
expectError: true,
185+
errorText: "Adding files to an existing rootfs is not yet",
186+
},
169187
{
170188
name: "Invalid include with no source",
171189
input: "///:bar",

0 commit comments

Comments
 (0)