From fdb2e54c3003721627c7191d9357db8fe6a8930c Mon Sep 17 00:00:00 2001 From: Alberto Carretero Date: Thu, 7 Mar 2024 17:30:32 +0100 Subject: [PATCH] test: remove deb package blob used for testing (#113) To make the content transparent and facilitate changing the package, this commit creates the deb used for testing programmatically instead of embedding it as a base64-encoded blob directly. --- internal/deb/extract_test.go | 277 +++++++++++---------- internal/slicer/slicer_test.go | 434 ++++++++++++++++----------------- internal/testutil/pkgdata.go | 168 ++----------- 3 files changed, 376 insertions(+), 503 deletions(-) diff --git a/internal/deb/extract_test.go b/internal/deb/extract_test.go index ae7a96cf..3cd09044 100644 --- a/internal/deb/extract_test.go +++ b/internal/deb/extract_test.go @@ -28,308 +28,303 @@ type extractTest struct { var extractTests = []extractTest{{ summary: "Extract nothing", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: nil, }, result: map[string]string{}, }, { summary: "Extract a few entries", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/usr/bin/hello": []deb.ExtractInfo{{ - Path: "/usr/bin/hello", + "/dir/file": []deb.ExtractInfo{{ + Path: "/dir/file", }}, - "/etc/os-release": []deb.ExtractInfo{{ - Path: "/etc/os-release", + "/dir/other-file": []deb.ExtractInfo{{ + Path: "/dir/other-file", }}, - "/usr/lib/os-release": []deb.ExtractInfo{{ - Path: "/usr/lib/os-release", + "/dir/several/levels/deep/file": []deb.ExtractInfo{{ + Path: "/dir/several/levels/deep/file", }}, - "/usr/share/doc/": []deb.ExtractInfo{{ - Path: "/usr/share/doc/", + "/dir/nested/": []deb.ExtractInfo{{ + Path: "/dir/nested/", }}, - "/tmp/": []deb.ExtractInfo{{ - Path: "/tmp/", + "/other-dir/": []deb.ExtractInfo{{ + Path: "/other-dir/", }}, }, }, result: map[string]string{ - "/tmp/": "dir 01777", - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello": "file 0775 eaf29575", - "/usr/share/": "dir 0755", - "/usr/share/doc/": "dir 0755", - "/usr/lib/": "dir 0755", - "/usr/lib/os-release": "file 0644 ec6fae43", - "/etc/": "dir 0755", - "/etc/os-release": "symlink ../usr/lib/os-release", + "/dir/": "dir 0755", + "/dir/file": "file 0644 cc55e2ec", + "/dir/nested/": "dir 0755", + "/dir/other-file": "file 0644 63d5dd49", + "/dir/several/": "dir 0755", + "/dir/several/levels/": "dir 0755", + "/dir/several/levels/deep/": "dir 0755", + "/dir/several/levels/deep/file": "file 0644 6bc26dff", + "/other-dir/": "dir 0755", }, notCreated: []string{}, }, { summary: "Extract a few entries, nil Create closure", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/usr/bin/hello": []deb.ExtractInfo{{ - Path: "/usr/bin/hello", + "/dir/file": []deb.ExtractInfo{{ + Path: "/dir/file", }}, - "/etc/os-release": []deb.ExtractInfo{{ - Path: "/etc/os-release", + "/dir/other-file": []deb.ExtractInfo{{ + Path: "/dir/other-file", }}, - "/usr/lib/os-release": []deb.ExtractInfo{{ - Path: "/usr/lib/os-release", + "/dir/several/levels/deep/file": []deb.ExtractInfo{{ + Path: "/dir/several/levels/deep/file", }}, - "/usr/share/doc/": []deb.ExtractInfo{{ - Path: "/usr/share/doc/", + "/dir/nested/": []deb.ExtractInfo{{ + Path: "/dir/nested/", }}, - "/tmp/": []deb.ExtractInfo{{ - Path: "/tmp/", + "/other-dir/": []deb.ExtractInfo{{ + Path: "/other-dir/", }}, }, }, result: map[string]string{ - "/tmp/": "dir 01777", - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello": "file 0775 eaf29575", - "/usr/share/": "dir 0755", - "/usr/share/doc/": "dir 0755", - "/usr/lib/": "dir 0755", - "/usr/lib/os-release": "file 0644 ec6fae43", - "/etc/": "dir 0755", - "/etc/os-release": "symlink ../usr/lib/os-release", + "/dir/": "dir 0755", + "/dir/file": "file 0644 cc55e2ec", + "/dir/nested/": "dir 0755", + "/dir/other-file": "file 0644 63d5dd49", + "/dir/several/": "dir 0755", + "/dir/several/levels/": "dir 0755", + "/dir/several/levels/deep/": "dir 0755", + "/dir/several/levels/deep/file": "file 0644 6bc26dff", + "/other-dir/": "dir 0755", }, hackopt: func(o *deb.ExtractOptions) { o.Create = nil }, }, { summary: "Copy a couple of entries elsewhere", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/usr/bin/hello": []deb.ExtractInfo{{ - Path: "/usr/foo/bin/hello-2", + "/dir/file": []deb.ExtractInfo{{ + Path: "/foo/file-copy", Mode: 0600, }}, - "/usr/share/": []deb.ExtractInfo{{ - Path: "/usr/other/", + "/dir/several/levels/deep/": []deb.ExtractInfo{{ + Path: "/foo/bar/dir-copy", Mode: 0700, }}, }, }, result: map[string]string{ - "/usr/": "dir 0755", - "/usr/foo/": "dir 0755", - "/usr/foo/bin/": "dir 0755", - "/usr/foo/bin/hello-2": "file 0600 eaf29575", - "/usr/other/": "dir 0700", + "/foo/": "dir 0755", + "/foo/bar/": "dir 0755", + "/foo/bar/dir-copy/": "dir 0700", + "/foo/file-copy": "file 0600 cc55e2ec", }, - notCreated: []string{"/usr/foo/", "/usr/foo/bin/"}, + notCreated: []string{"/foo/", "/foo/bar/"}, }, { summary: "Copy same file twice", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/usr/bin/hello": []deb.ExtractInfo{{ - Path: "/usr/bin/hello", + "/dir/file": []deb.ExtractInfo{{ + Path: "/dir/foo/file-copy-1", }, { - Path: "/usr/bin/hallo", + Path: "/dir/bar/file-copy-2", }}, }, }, result: map[string]string{ - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello": "file 0775 eaf29575", - "/usr/bin/hallo": "file 0775 eaf29575", + "/dir/": "dir 0755", + "/dir/bar/": "dir 0755", + "/dir/bar/file-copy-2": "file 0644 cc55e2ec", + "/dir/foo/": "dir 0755", + "/dir/foo/file-copy-1": "file 0644 cc55e2ec", }, - notCreated: []string{}, + notCreated: []string{"/dir/bar/", "/dir/foo/"}, }, { summary: "Globbing a single dir level", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/d*/": []deb.ExtractInfo{{ - Path: "/etc/d*/", + "/dir/s*/": []deb.ExtractInfo{{ + Path: "/dir/s*/", }}, }, }, result: map[string]string{ - "/etc/": "dir 0755", - "/etc/dpkg/": "dir 0755", - "/etc/default/": "dir 0755", + "/dir/": "dir 0755", + "/dir/several/": "dir 0755", }, - notCreated: []string{"/etc/"}, + notCreated: []string{"/dir/"}, }, { summary: "Globbing for files with multiple levels at once", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/d**": []deb.ExtractInfo{{ - Path: "/etc/d**", + "/dir/s**": []deb.ExtractInfo{{ + Path: "/dir/s**", }}, }, }, result: map[string]string{ - "/etc/": "dir 0755", - "/etc/dpkg/": "dir 0755", - "/etc/dpkg/origins/": "dir 0755", - "/etc/dpkg/origins/debian": "file 0644 50f35af8", - "/etc/dpkg/origins/ubuntu": "file 0644 d2537b95", - "/etc/default/": "dir 0755", - "/etc/debian_version": "file 0644 cce26cfe", + "/dir/": "dir 0755", + "/dir/several/": "dir 0755", + "/dir/several/levels/": "dir 0755", + "/dir/several/levels/deep/": "dir 0755", + "/dir/several/levels/deep/file": "file 0644 6bc26dff", }, - notCreated: []string{"/etc/"}, + notCreated: []string{"/dir/"}, }, { summary: "Globbing with reporting of globbed paths", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/de**": []deb.ExtractInfo{{ - Path: "/etc/de**", + "/dir/s**": []deb.ExtractInfo{{ + Path: "/dir/s**", }}, - "/etc/dp*/": []deb.ExtractInfo{{ - Path: "/etc/dp*/", + "/dir/n*/": []deb.ExtractInfo{{ + Path: "/dir/n*/", }}, }, }, result: map[string]string{ - "/etc/": "dir 0755", - "/etc/dpkg/": "dir 0755", - "/etc/default/": "dir 0755", - "/etc/debian_version": "file 0644 cce26cfe", + "/dir/": "dir 0755", + "/dir/nested/": "dir 0755", + "/dir/several/": "dir 0755", + "/dir/several/levels/": "dir 0755", + "/dir/several/levels/deep/": "dir 0755", + "/dir/several/levels/deep/file": "file 0644 6bc26dff", }, globbed: map[string][]string{ - "/etc/dp*/": []string{"/etc/dpkg/"}, - "/etc/de**": []string{"/etc/debian_version", "/etc/default/"}, + "/dir/n*/": []string{"/dir/nested/"}, + "/dir/s**": []string{"/dir/several/", "/dir/several/levels/", "/dir/several/levels/deep/", "/dir/several/levels/deep/file"}, }, - notCreated: []string{"/etc/"}, + notCreated: []string{"/dir/"}, }, { summary: "Globbing must have matching source and target", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/d**": []deb.ExtractInfo{{ - Path: "/etc/g**", + "/foo/b**": []deb.ExtractInfo{{ + Path: "/foo/g**", }}, }, }, - error: `cannot extract .*: when using wildcards source and target paths must match: /etc/d\*\*`, + error: `cannot extract .*: when using wildcards source and target paths must match: /foo/b\*\*`, }, { summary: "Globbing must also have a single target", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/d**": []deb.ExtractInfo{{ - Path: "/etc/d**", + "/foo/b**": []deb.ExtractInfo{{ + Path: "/foo/b**", }, { - Path: "/etc/d**", + Path: "/foo/g**", }}, }, }, - error: `cannot extract .*: when using wildcards source and target paths must match: /etc/d\*\*`, + error: `cannot extract .*: when using wildcards source and target paths must match: /foo/b\*\*`, }, { summary: "Globbing cannot change modes", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/d**": []deb.ExtractInfo{{ - Path: "/etc/d**", + "/dir/n**": []deb.ExtractInfo{{ + Path: "/dir/n**", Mode: 0777, }}, }, }, - error: `cannot extract .*: when using wildcards source and target paths must match: /etc/d\*\*`, + error: `cannot extract .*: when using wildcards source and target paths must match: /dir/n\*\*`, }, { summary: "Missing file", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/passwd": []deb.ExtractInfo{{ - Path: "/etc/passwd", + "/missing-file": []deb.ExtractInfo{{ + Path: "/missing-file", }}, }, }, - error: `cannot extract from package "base-files": no content at /etc/passwd`, + error: `cannot extract from package "test-package": no content at /missing-file`, }, { summary: "Missing directory", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etd/": []deb.ExtractInfo{{ - Path: "/etd/", + "/missing-dir/": []deb.ExtractInfo{{ + Path: "/missing-dir/", }}, }, }, - error: `cannot extract from package "base-files": no content at /etd/`, + error: `cannot extract from package "test-package": no content at /missing-dir/`, }, { summary: "Missing glob", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etd/**": []deb.ExtractInfo{{ - Path: "/etd/**", + "/missing-dir/**": []deb.ExtractInfo{{ + Path: "/missing-dir/**", }}, }, }, - error: `cannot extract from package "base-files": no content at /etd/\*\*`, + error: `cannot extract from package "test-package": no content at /missing-dir/\*\*`, }, { summary: "Missing multiple entries", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/passwd": []deb.ExtractInfo{{ - Path: "/etc/passwd", + "/missing-file": []deb.ExtractInfo{{ + Path: "missing-file", }}, - "/etd/": []deb.ExtractInfo{{ - Path: "/etd/", + "/missing-dir/": []deb.ExtractInfo{{ + Path: "/missing-dir/", }}, }, }, - error: `cannot extract from package "base-files": no content at:\n- /etc/passwd\n- /etd/`, + error: `cannot extract from package "test-package": no content at:\n- /missing-dir/\n- /missing-file`, }, { summary: "Optional entries may be missing", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/etc/": []deb.ExtractInfo{{ - Path: "/etc/", + "/dir/": []deb.ExtractInfo{{ + Path: "/dir/", }}, - "/usr/foo/hallo": []deb.ExtractInfo{{ - Path: "/usr/bin/foo/hallo", + "/dir/optional": []deb.ExtractInfo{{ + Path: "/other-dir/foo", Optional: true, }}, - "/other/path/": []deb.ExtractInfo{{ - Path: "/tmp/new/path/", + "/optional-dir/": []deb.ExtractInfo{{ + Path: "/foo/optional-dir/", Optional: true, }}, }, }, result: map[string]string{ - "/etc/": "dir 0755", - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/tmp/": "dir 01777", + "/dir/": "dir 0755", + "/other-dir/": "dir 0755", }, notCreated: []string{}, }, { summary: "Optional entries mixed in cannot be missing", - pkgdata: testutil.PackageData["base-files"], + pkgdata: testutil.PackageData["test-package"], options: deb.ExtractOptions{ Extract: map[string][]deb.ExtractInfo{ - "/usr/bin/hallo": []deb.ExtractInfo{{ - Path: "/usr/bin/hallo", + "/dir/missing-file": []deb.ExtractInfo{{ + Path: "/dir/optional", Optional: true, }, { - Path: "/usr/bin/hallow", + Path: "/dir/not-optional", Optional: false, }}, }, }, - error: `cannot extract from package "base-files": no content at /usr/bin/hallo`, + error: `cannot extract from package "test-package": no content at /dir/missing-file`, }} func (s *S) TestExtract(c *C) { @@ -338,7 +333,7 @@ func (s *S) TestExtract(c *C) { c.Logf("Test: %s", test.summary) dir := c.MkDir() options := test.options - options.Package = "base-files" + options.Package = "test-package" options.TargetDir = dir createdPaths := make(map[string]bool) options.Create = func(o *fsutil.CreateOptions) error { diff --git a/internal/slicer/slicer_test.go b/internal/slicer/slicer_test.go index be90603e..f1ca6fed 100644 --- a/internal/slicer/slicer_test.go +++ b/internal/slicer/slicer_test.go @@ -65,356 +65,352 @@ var packageEntries = map[string][]testutil.TarEntry{ }, } -// filesystem entries of copyright file from base-files package that will be -// automatically injected into every slice +// Hardcoded copyright files from test-package package that will be automatically +// injected into every slice. var copyrightEntries = map[string]string{ - "/usr/": "dir 0755", - "/usr/share/": "dir 0755", - "/usr/share/doc/": "dir 0755", - "/usr/share/doc/base-files/": "dir 0755", - "/usr/share/doc/base-files/copyright": "file 0644 cdb5461d", + "/usr/": "dir 0755", + "/usr/share/": "dir 0755", + "/usr/share/doc/": "dir 0755", + "/usr/share/doc/test-package/": "dir 0755", + "/usr/share/doc/test-package/copyright": "file 0644 c2fca2aa", } var slicerTests = []slicerTest{{ summary: "Basic slicing", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /usr/bin/hello: - /usr/bin/hallo: {copy: /usr/bin/hello} - /bin/hallo: {symlink: ../usr/bin/hallo} - /etc/passwd: {text: data1} - /etc/dir/sub/: {make: true, mode: 01777} + /dir/file: + /dir/file-copy: {copy: /dir/file} + /other-dir/file: {symlink: ../dir/file} + /dir/text-file: {text: data1} + /dir/foo/bar/: {make: true, mode: 01777} `, }, filesystem: map[string]string{ - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello": "file 0775 eaf29575", - "/usr/bin/hallo": "file 0775 eaf29575", - "/bin/": "dir 0755", - "/bin/hallo": "symlink ../usr/bin/hallo", - "/etc/": "dir 0755", - "/etc/dir/": "dir 0755", - "/etc/dir/sub/": "dir 01777", - "/etc/passwd": "file 0644 5b41362b", + "/dir/": "dir 0755", + "/dir/file": "file 0644 cc55e2ec", + "/dir/file-copy": "file 0644 cc55e2ec", + "/dir/foo/": "dir 0755", + "/dir/foo/bar/": "dir 01777", + "/dir/text-file": "file 0644 5b41362b", + "/other-dir/": "dir 0755", + "/other-dir/file": "symlink ../dir/file", }, report: map[string]string{ - "/bin/": "dir 0755 {base-files_myslice}", - "/bin/hallo": "symlink ../usr/bin/hallo {base-files_myslice}", - "/etc/": "dir 0755 {base-files_myslice}", - "/etc/dir/sub/": "dir 01777 {base-files_myslice}", - "/etc/passwd": "file 0644 5b41362b {base-files_myslice}", - "/usr/": "dir 0755 {base-files_myslice}", - "/usr/bin/": "dir 0755 {base-files_myslice}", - "/usr/bin/hallo": "file 0775 eaf29575 {base-files_myslice}", - "/usr/bin/hello": "file 0775 eaf29575 {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/file": "file 0644 cc55e2ec {test-package_myslice}", + "/dir/file-copy": "file 0644 cc55e2ec {test-package_myslice}", + "/dir/foo/bar/": "dir 01777 {test-package_myslice}", + "/dir/text-file": "file 0644 5b41362b {test-package_myslice}", + "/other-dir/": "dir 0755 {test-package_myslice}", + "/other-dir/file": "symlink ../dir/file {test-package_myslice}", }, }, { summary: "Glob extraction", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /**/he*o: + /**/other-f*e: `, }, filesystem: map[string]string{ - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello": "file 0775 eaf29575", + "/dir/": "dir 0755", + "/dir/nested/": "dir 0755", + "/dir/nested/other-file": "file 0644 6b86b273", + "/dir/other-file": "file 0644 63d5dd49", }, report: map[string]string{ - "/usr/": "dir 0755 {base-files_myslice}", - "/usr/bin/hello": "file 0775 eaf29575 {base-files_myslice}", + "/dir/nested/other-file": "file 0644 6b86b273 {test-package_myslice}", + "/dir/other-file": "file 0644 63d5dd49 {test-package_myslice}", }, }, { - summary: "Create new file under extracted directory", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + summary: "Create new file under extracted directory and preserve parent directory permissions", + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - # Note the missing /tmp/ here. - /tmp/new: {text: data1} + # Note the missing /parent/ here. + /parent/new: {text: data1} `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", // This is the magic. - "/tmp/new": "file 0644 5b41362b", + "/parent/": "dir 01777", // This is the magic. + "/parent/new": "file 0644 5b41362b", }, report: map[string]string{ - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/new": "file 0644 5b41362b {base-files_myslice}", + "/parent/": "dir 01777 {test-package_myslice}", + "/parent/new": "file 0644 5b41362b {test-package_myslice}", }, }, { - summary: "Create new nested file under extracted directory", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + summary: "Create new nested file under extracted directory and preserve parent directory permissions", + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - # Note the missing /tmp/ here. - /tmp/new/sub: {text: data1} + # Note the missing /parent/ and /parent/permissions/ here. + /parent/permissions/new: {text: data1} `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", // This is the magic. - "/tmp/new/": "dir 0755", - "/tmp/new/sub": "file 0644 5b41362b", + "/parent/": "dir 01777", // This is the magic. + "/parent/permissions/": "dir 0764", // This is the magic. + "/parent/permissions/new": "file 0644 5b41362b", }, report: map[string]string{ - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/new/sub": "file 0644 5b41362b {base-files_myslice}", + "/parent/": "dir 01777 {test-package_myslice}", + "/parent/permissions/": "dir 0764 {test-package_myslice}", + "/parent/permissions/new": "file 0644 5b41362b {test-package_myslice}", }, }, { - summary: "Create new directory under extracted directory", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + summary: "Create new directory under extracted directory and preserve parent directory permissions", + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - # Note the missing /tmp/ here. - /tmp/new/: {make: true} + # Note the missing /parent/ here. + /parent/new/: {make: true} `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", // This is the magic. - "/tmp/new/": "dir 0755", + "/parent/": "dir 01777", // This is the magic. + "/parent/new/": "dir 0755", }, report: map[string]string{ - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/new/": "dir 0755 {base-files_myslice}", + "/parent/": "dir 01777 {test-package_myslice}", + "/parent/new/": "dir 0755 {test-package_myslice}", }, }, { summary: "Conditional architecture", arch: "amd64", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /tmp/file1: {text: data1, arch: amd64} - /tmp/file2: {text: data1, arch: i386} - /tmp/file3: {text: data1, arch: [i386, amd64]} - /usr/bin/hello1: {copy: /usr/bin/hello, arch: amd64} - /usr/bin/hello2: {copy: /usr/bin/hello, arch: i386} - /usr/bin/hello3: {copy: /usr/bin/hello, arch: [i386, amd64]} + /dir/text-file-1: {text: data1, arch: amd64} + /dir/text-file-2: {text: data1, arch: i386} + /dir/text-file-3: {text: data1, arch: [i386, amd64]} + /dir/nested/copy-1: {copy: /dir/nested/file, arch: amd64} + /dir/nested/copy-2: {copy: /dir/nested/file, arch: i386} + /dir/nested/copy-3: {copy: /dir/nested/file, arch: [i386, amd64]} `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", - "/tmp/file1": "file 0644 5b41362b", - "/tmp/file3": "file 0644 5b41362b", - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello1": "file 0775 eaf29575", - "/usr/bin/hello3": "file 0775 eaf29575", + "/dir/": "dir 0755", + "/dir/text-file-1": "file 0644 5b41362b", + "/dir/text-file-3": "file 0644 5b41362b", + "/dir/nested/": "dir 0755", + "/dir/nested/copy-1": "file 0644 84237a05", + "/dir/nested/copy-3": "file 0644 84237a05", }, report: map[string]string{ - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/file1": "file 0644 5b41362b {base-files_myslice}", - "/tmp/file3": "file 0644 5b41362b {base-files_myslice}", - "/usr/": "dir 0755 {base-files_myslice}", - "/usr/bin/": "dir 0755 {base-files_myslice}", - "/usr/bin/hello1": "file 0775 eaf29575 {base-files_myslice}", - "/usr/bin/hello3": "file 0775 eaf29575 {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/nested/": "dir 0755 {test-package_myslice}", + "/dir/nested/copy-1": "file 0644 84237a05 {test-package_myslice}", + "/dir/nested/copy-3": "file 0644 84237a05 {test-package_myslice}", + "/dir/text-file-1": "file 0644 5b41362b {test-package_myslice}", + "/dir/text-file-3": "file 0644 5b41362b {test-package_myslice}", }, }, { summary: "Script: write a file", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /tmp/file1: {text: data1, mutable: true} + /dir/text-file: {text: data1, mutable: true} mutate: | - content.write("/tmp/file1", "data2") + content.write("/dir/text-file", "data2") `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", - "/tmp/file1": "file 0644 d98cf53e", + "/dir/": "dir 0755", + "/dir/text-file": "file 0644 d98cf53e", }, report: map[string]string{ - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/file1": "file 0644 5b41362b {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/text-file": "file 0644 5b41362b {test-package_myslice}", }, }, { summary: "Script: read a file", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /tmp/file1: {text: data1} - /foo/file2: {text: data2, mutable: true} + /dir/text-file-1: {text: data1} + /foo/text-file-2: {text: data2, mutable: true} mutate: | - data = content.read("/tmp/file1") - content.write("/foo/file2", data) + data = content.read("/dir/text-file-1") + content.write("/foo/text-file-2", data) `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", - "/tmp/file1": "file 0644 5b41362b", - "/foo/": "dir 0755", - "/foo/file2": "file 0644 5b41362b", + "/dir/": "dir 0755", + "/dir/text-file-1": "file 0644 5b41362b", + "/foo/": "dir 0755", + "/foo/text-file-2": "file 0644 5b41362b", }, report: map[string]string{ - "/foo/file2": "file 0644 d98cf53e {base-files_myslice}", - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/file1": "file 0644 5b41362b {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/text-file-1": "file 0644 5b41362b {test-package_myslice}", + "/foo/text-file-2": "file 0644 d98cf53e {test-package_myslice}", }, }, { summary: "Script: use 'until' to remove file after mutate", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /tmp/file1: {text: data1, until: mutate} - /foo/file2: {text: data2, mutable: true} + /dir/text-file-1: {text: data1, until: mutate} + /foo/text-file-2: {text: data2, mutable: true} mutate: | - data = content.read("/tmp/file1") - content.write("/foo/file2", data) + data = content.read("/dir/text-file-1") + content.write("/foo/text-file-2", data) `, }, filesystem: map[string]string{ - "/tmp/": "dir 01777", - "/foo/": "dir 0755", - "/foo/file2": "file 0644 5b41362b", + "/dir/": "dir 0755", + "/foo/": "dir 0755", + "/foo/text-file-2": "file 0644 5b41362b", }, report: map[string]string{ - "/foo/file2": "file 0644 d98cf53e {base-files_myslice}", - "/tmp/": "dir 01777 {base-files_myslice}", - "/tmp/file1": "file 0644 5b41362b {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/text-file-1": "file 0644 5b41362b {test-package_myslice}", + "/foo/text-file-2": "file 0644 d98cf53e {test-package_myslice}", }, }, { summary: "Script: use 'until' to remove wildcard after mutate", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /usr/bin**: {until: mutate} - /etc/passwd: {until: mutate, text: data1} + /dir/nested**: {until: mutate} + /other-dir/text-file: {until: mutate, text: data1} `, }, filesystem: map[string]string{ - "/usr/": "dir 0755", - "/etc/": "dir 0755", + "/dir/": "dir 0755", + "/other-dir/": "dir 0755", }, report: map[string]string{ - "/etc/": "dir 0755 {base-files_myslice}", - "/etc/passwd": "file 0644 5b41362b {base-files_myslice}", - "/usr/": "dir 0755 {base-files_myslice}", - "/usr/bin/": "dir 0755 {base-files_myslice}", - "/usr/bin/hello": "file 0775 eaf29575 {base-files_myslice}", + "/dir/nested/": "dir 0755 {test-package_myslice}", + "/dir/nested/file": "file 0644 84237a05 {test-package_myslice}", + "/dir/nested/other-file": "file 0644 6b86b273 {test-package_myslice}", + "/other-dir/": "dir 0755 {test-package_myslice}", + "/other-dir/text-file": "file 0644 5b41362b {test-package_myslice}", }, }, { summary: "Script: 'until' does not remove non-empty directories", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /usr/bin/: {until: mutate} - /usr/bin/hallo: {copy: /usr/bin/hello} + /dir/nested/: {until: mutate} + /dir/nested/file-copy: {copy: /dir/file} `, }, filesystem: map[string]string{ - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hallo": "file 0775 eaf29575", + "/dir/": "dir 0755", + "/dir/nested/": "dir 0755", + "/dir/nested/file-copy": "file 0644 cc55e2ec", }, report: map[string]string{ - "/usr/": "dir 0755 {base-files_myslice}", - "/usr/bin/": "dir 0755 {base-files_myslice}", - "/usr/bin/hallo": "file 0775 eaf29575 {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/nested/": "dir 0755 {test-package_myslice}", + "/dir/nested/file-copy": "file 0644 cc55e2ec {test-package_myslice}", }, }, { summary: "Script: cannot write non-mutable files", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /tmp/file1: {text: data1} + /dir/text-file: {text: data1} mutate: | - content.write("/tmp/file1", "data2") + content.write("/dir/text-file", "data2") `, }, - error: `slice base-files_myslice: cannot write file which is not mutable: /tmp/file1`, + error: `slice test-package_myslice: cannot write file which is not mutable: /dir/text-file`, }, { summary: "Script: cannot read unlisted content", - slices: []setup.SliceKey{{"base-files", "myslice2"}}, + slices: []setup.SliceKey{{"test-package", "myslice2"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice1: contents: - /tmp/file1: {text: data1} + /dir/text-file: {text: data1} myslice2: mutate: | - content.read("/tmp/file1") + content.read("/dir/text-file") `, }, - error: `slice base-files_myslice2: cannot read file which is not selected: /tmp/file1`, + error: `slice test-package_myslice2: cannot read file which is not selected: /dir/text-file`, }, { summary: "Script: can read globbed content", - slices: []setup.SliceKey{{"base-files", "myslice1"}, {"base-files", "myslice2"}}, + slices: []setup.SliceKey{{"test-package", "myslice1"}, {"test-package", "myslice2"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice1: contents: - /usr/bin/*: + /dir/nested/fil*: myslice2: mutate: | - content.read("/usr/bin/hello") + content.read("/dir/nested/file") `, }, }, { summary: "Relative content root directory must not error", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /tmp/file1: {text: data1} + /dir/text-file: {text: data1} mutate: | - content.read("/tmp/file1") + content.read("/dir/text-file") `, }, hackopt: func(c *C, opts *slicer.RunOptions) { @@ -425,10 +421,10 @@ var slicerTests = []slicerTest{{ }, }, { summary: "Can list parent directories of normal paths", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: @@ -444,10 +440,10 @@ var slicerTests = []slicerTest{{ }, }, { summary: "Cannot list unselected directory", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: @@ -456,13 +452,13 @@ var slicerTests = []slicerTest{{ content.list("/a/d") `, }, - error: `slice base-files_myslice: cannot list directory which is not selected: /a/d/`, + error: `slice test-package_myslice: cannot list directory which is not selected: /a/d/`, }, { summary: "Cannot list file path as a directory", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: @@ -471,36 +467,36 @@ var slicerTests = []slicerTest{{ content.list("/a/b/c") `, }, - error: `slice base-files_myslice: content is not a directory: /a/b/c`, + error: `slice test-package_myslice: content is not a directory: /a/b/c`, }, { summary: "Can list parent directories of globs", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /**/bin/h?llo: + /**/nested/f?le: mutate: | - content.list("/usr/bin") + content.list("/dir/nested") `, }, }, { summary: "Cannot list directories not matched by glob", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: - /**/bin/h?llo: + /**/nested/f?le: mutate: | - content.list("/etc") + content.list("/other-dir") `, }, - error: `slice base-files_myslice: cannot list directory which is not selected: /etc/`, + error: `slice test-package_myslice: cannot list directory which is not selected: /other-dir/`, }, { summary: "Duplicate copyright symlink is ignored", slices: []setup.SliceKey{{"copyright-symlink-openssl", "bins"}}, @@ -528,10 +524,10 @@ var slicerTests = []slicerTest{{ }, }, { summary: "Can list unclean directory paths", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: @@ -547,10 +543,10 @@ var slicerTests = []slicerTest{{ }, }, { summary: "Cannot read directories", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package slices: myslice: contents: @@ -559,10 +555,10 @@ var slicerTests = []slicerTest{{ content.read("/x/y") `, }, - error: `slice base-files_myslice: content is not a file: /x/y`, + error: `slice test-package_myslice: content is not a file: /x/y`, }, { summary: "Non-default archive", - slices: []setup.SliceKey{{"base-files", "myslice"}}, + slices: []setup.SliceKey{{"test-package", "myslice"}}, release: map[string]string{ "chisel.yaml": ` format: chisel-v1 @@ -581,24 +577,24 @@ var slicerTests = []slicerTest{{ id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` `, - "slices/mydir/base-files.yaml": ` - package: base-files + "slices/mydir/test-package.yaml": ` + package: test-package archive: bar slices: myslice: contents: - /usr/bin/hello: + /dir/nested/file: `, }, filesystem: map[string]string{ - "/usr/": "dir 0755", - "/usr/bin/": "dir 0755", - "/usr/bin/hello": "file 0775 eaf29575", + "/dir/": "dir 0755", + "/dir/nested/": "dir 0755", + "/dir/nested/file": "file 0644 84237a05", }, report: map[string]string{ - "/usr/": "dir 0755 {base-files_myslice}", - "/usr/bin/": "dir 0755 {base-files_myslice}", - "/usr/bin/hello": "file 0775 eaf29575 {base-files_myslice}", + "/dir/": "dir 0755 {test-package_myslice}", + "/dir/nested/": "dir 0755 {test-package_myslice}", + "/dir/nested/file": "file 0644 84237a05 {test-package_myslice}", }, }} @@ -681,7 +677,7 @@ func runSlicerTests(c *C, tests []slicerTest) { c.Assert(err, IsNil) pkgs := map[string][]byte{ - "base-files": testutil.PackageData["base-files"], + "test-package": testutil.PackageData["test-package"], } for name, entries := range packageEntries { deb, err := testutil.MakeDeb(entries) @@ -734,7 +730,7 @@ func runSlicerTests(c *C, tests []slicerTest) { if test.report != nil { result := make(map[string]string, len(copyrightEntries)+len(test.filesystem)) for k, v := range copyrightEntries { - result[k] = v + " {base-files_myslice}" + result[k] = v + " {test-package_myslice}" } for k, v := range test.report { result[k] = v diff --git a/internal/testutil/pkgdata.go b/internal/testutil/pkgdata.go index 7610cd11..4142f785 100644 --- a/internal/testutil/pkgdata.go +++ b/internal/testutil/pkgdata.go @@ -3,7 +3,6 @@ package testutil import ( "archive/tar" "bytes" - "encoding/base64" "strings" "time" @@ -13,150 +12,33 @@ import ( var PackageData = map[string][]byte{} -func init() { - baseFilesData, err := base64.StdEncoding.DecodeString(baseFilesBase64) - if err != nil { - panic("broken package base64") - } - PackageData["base-files"] = baseFilesData +var testPackageEntries = []TarEntry{ + Dir(0755, "./"), + Dir(0755, "./dir/"), + Reg(0644, "./dir/file", "12u3q0wej ajsd"), + Reg(0644, "./dir/other-file", "kasjdf0"), + Dir(0755, "./dir/nested/"), + Reg(0644, "./dir/nested/file", "0jqei"), + Reg(0644, "./dir/nested/other-file", "1"), + Dir(0755, "./dir/several/"), + Dir(0755, "./dir/several/levels/"), + Dir(0755, "./dir/several/levels/deep/"), + Reg(0644, "./dir/several/levels/deep/file", "129i381 "), + Dir(0755, "./other-dir/"), + Dir(01777, "./parent/"), + Dir(0764, "./parent/permissions/"), + Reg(0755, "./parent/permissions/file", "ajse0"), + // Hardcoded copyright paths. + Dir(0755, "./usr/"), + Dir(0755, "./usr/share/"), + Dir(0755, "./usr/share/doc/"), + Dir(0755, "./usr/share/doc/test-package/"), + Reg(0644, "./usr/share/doc/test-package/copyright", "copyright"), } -var baseFilesBase64 = ` -ITxhcmNoPgpkZWJpYW4tYmluYXJ5ICAgMTY1ODc3NTg3OCAgMCAgICAgMCAgICAgMTAwNjQ0ICA0 -ICAgICAgICAgYAoyLjAKY29udHJvbC50YXIuenN0IDE2NTg3NzU4NzggIDAgICAgIDAgICAgIDEw -MDY0NCAgMjU0MSAgICAgIGAKKLUv/QBoJU8A6mPQESrQclYPKo5EEKbZ+GoErdlOzmG7e3YWFQdB -OGH5dj7o5SCZyItczYC+0OgUARIBEA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XFhjoHIK1kTo+EtfnoGAzLJLm6CJLw6SXGjKb1TQXeQJLnl45+ -dYiMSUn6m9CRdG1QGWGkEvvSAmzgsWQDboABkB3AD3HJ+dsigMkGdILs/WiKAwc9AHZFcI5Fg5O0 -/xmyAfifAzCJjEd5BKZ1gLK4sb3eItKNr7mAaa3dCb+DkHsMbZphWlmBlMNTA0hlHIHOa4Z7BAQ7 -BIsAGAJD+LGgIzDiD2ntudH6JU80wD0rklyRGBV2dEx8VJG5LVwpcXb8PI0lMdi+wwUPoBkQGEIN -7UwLQKMDjg8YkdmAmRrEgCSRRhMWBgBBSuI7S4BVs7zODfj1ja0TF+KbjdQDGANIcRlZhwzQSlla -abj2Z7KoYMBXz9dwNNP2Aw13FguKkogezW5cqy4lCg== -` +func init() { + PackageData["test-package"] = MustMakeDeb(testPackageEntries) +} type TarEntry struct { Header tar.Header