@@ -56,9 +56,9 @@ func init() {
5656// TestTranslateFile tests translating the ct storage.files.[i] entries to ignition storage.files.[i] entries.
5757func TestTranslateFile (t * testing.T ) {
5858 zzz := "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
59- zzz_gz := "data:;base64,H4sIAAAAAAAC/6oajAAQAAD//5tA8d+VAAAA"
59+ zzzURI , zzzCompression := baseutil . CompressDataURL ( t , [] byte ( zzz ))
6060 random := "\xc0 \x9c l\x01 \x89 i\xa5 \xbf W\xe4 \x1b \xf4 J_\xb7 9P\xa3 #\xa7 "
61- random_b64 := "data:;base64,wJxsAYlppb9X5Bv0Sl+3OVCjI6c="
61+ randomURI , randomCompression := baseutil . CompressDataURL ( t , [] byte ( random ))
6262
6363 filesDir := t .TempDir ()
6464 fileContents := map [string ]string {
@@ -477,21 +477,21 @@ func TestTranslateFile(t *testing.T) {
477477 },
478478 FileEmbedded1 : types.FileEmbedded1 {
479479 Contents : types.Resource {
480- Source : util .StrToPtr (zzz_gz ),
481- Compression : util .StrToPtr ("gzip" ),
480+ Source : util .StrToPtr (zzzURI ),
481+ Compression : util .StrToPtr (zzzCompression ),
482482 },
483483 Append : []types.Resource {
484484 {
485- Source : util .StrToPtr (zzz_gz ),
486- Compression : util .StrToPtr ("gzip" ),
485+ Source : util .StrToPtr (zzzURI ),
486+ Compression : util .StrToPtr (zzzCompression ),
487487 },
488488 {
489- Source : util .StrToPtr (random_b64 ),
490- Compression : util .StrToPtr ("" ),
489+ Source : util .StrToPtr (randomURI ),
490+ Compression : util .StrToPtr (randomCompression ),
491491 },
492492 {
493- Source : util .StrToPtr (random_b64 ),
494- Compression : util .StrToPtr ("" ),
493+ Source : util .StrToPtr (randomURI ),
494+ Compression : util .StrToPtr (randomCompression ),
495495 },
496496 {
497497 Source : util .StrToPtr ("data:," + zzz ),
@@ -1116,6 +1116,9 @@ RequiredBy=remote-fs.target`),
11161116
11171117// TestTranslateTree tests translating the butane storage.trees.[i] entries to ignition storage.files.[i] entries.
11181118func TestTranslateTree (t * testing.T ) {
1119+ deepPath := "tree/subdir/subdir/subdir/subdir/subdir/subdir/subdir/subdir/subdir/file"
1120+ deepPathURI , deepPathCompression := baseutil .CompressDataURL (t , []byte (deepPath ))
1121+
11191122 tests := []struct {
11201123 options * common.TranslateOptions // defaulted if not specified
11211124 dirDirs map [string ]os.FileMode // relative path -> mode
@@ -1263,8 +1266,8 @@ func TestTranslateTree(t *testing.T) {
12631266 },
12641267 FileEmbedded1 : types.FileEmbedded1 {
12651268 Contents : types.Resource {
1266- Source : util .StrToPtr ("data:;base64,H4sIAAAAAAAC/yopSk3VLy5NSsksIptKy8xJBQQAAP//gkRzjkgAAAA=" ),
1267- Compression : util .StrToPtr ("gzip" ),
1269+ Source : util .StrToPtr (deepPathURI ),
1270+ Compression : util .StrToPtr (deepPathCompression ),
12681271 },
12691272 Mode : util .IntToPtr (0644 ),
12701273 },
0 commit comments