mirror of
https://github.com/containers/skopeo.git
synced 2025-04-27 11:01:18 +00:00
Split decompressDir from runDecompressDirs
... so that we have a new function which only decompresses one image at a time. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
5980989f66
commit
09f282e468
@ -194,19 +194,25 @@ func runDecompressDirs(t *testing.T, args ...string) {
|
||||
m, err := os.ReadFile(filepath.Join(dir, "manifest.json"))
|
||||
require.NoError(t, err)
|
||||
t.Logf("manifest %d before: %s", i+1, string(m))
|
||||
}
|
||||
out, err := exec.Command(decompressDirsBinary, args...).CombinedOutput()
|
||||
assert.NoError(t, err, "%s", out)
|
||||
for i, dir := range args {
|
||||
if len(out) > 0 {
|
||||
t.Logf("output: %s", out)
|
||||
}
|
||||
m, err := os.ReadFile(filepath.Join(dir, "manifest.json"))
|
||||
|
||||
decompressDir(t, dir)
|
||||
|
||||
m, err = os.ReadFile(filepath.Join(dir, "manifest.json"))
|
||||
require.NoError(t, err)
|
||||
t.Logf("manifest %d after: %s", i+1, string(m))
|
||||
}
|
||||
}
|
||||
|
||||
// decompressDir modifies a dir:-formatted directory to replace gzip-compressed layers with uncompressed variants,
|
||||
// and to use a ~canonical formatting of manifest.json.
|
||||
func decompressDir(t *testing.T, dir string) {
|
||||
out, err := exec.Command(decompressDirsBinary, dir).CombinedOutput()
|
||||
assert.NoError(t, err, "%s", out)
|
||||
if len(out) > 0 {
|
||||
t.Logf("output: %s", out)
|
||||
}
|
||||
}
|
||||
|
||||
// Verify manifest in a dir: image at dir is expectedMIMEType.
|
||||
func verifyManifestMIMEType(t *testing.T, dir string, expectedMIMEType string) {
|
||||
manifestBlob, err := os.ReadFile(filepath.Join(dir, "manifest.json"))
|
||||
|
Loading…
Reference in New Issue
Block a user