internal/pkg: remove tar built-in decompressor
All checks were successful
Test / Create distribution (push) Successful in 1m30s
Test / Sandbox (push) Successful in 5m13s
Test / Hakurei (push) Successful in 7m56s
Test / ShareFS (push) Successful in 7m57s
Test / Hakurei (race detector) (push) Successful in 10m12s
Test / Sandbox (race detector) (push) Successful in 3m3s
Test / Flake checks (push) Successful in 1m47s
All checks were successful
Test / Create distribution (push) Successful in 1m30s
Test / Sandbox (push) Successful in 5m13s
Test / Hakurei (push) Successful in 7m56s
Test / ShareFS (push) Successful in 7m57s
Test / Hakurei (race detector) (push) Successful in 10m12s
Test / Sandbox (race detector) (push) Successful in 3m3s
Test / Flake checks (push) Successful in 1m47s
This is replaced by decompressArtifact and is no longer necessary. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -80,8 +80,8 @@ func TestTar(t *testing.T) {
|
||||
"checksum/" + wantEncode + "/work": {Mode: fs.ModeDir | 0500},
|
||||
|
||||
"identifier": {Mode: fs.ModeDir | 0700},
|
||||
"identifier/W5S65DEhawz_WKaok5NjUKLmnD9dNl5RPauNJjcOVcB3VM4eGhSaLGmXbL8vZpiw": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantEncode)},
|
||||
"identifier/rg7F1D5hwv6o4xctjD5zDq4i5MD0mArTsUIWfhUbik8xC6Bsyt3mjXXOm3goojTz": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantEncode)},
|
||||
"identifier/T68YqeEW5moiwVe4J0wPvjERgyMUd4k_cKKxTcQx6AXqZaQAuuryu-Iv-qxDV6-T": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantEncode)},
|
||||
"identifier/WbWIIUGl6bqDBsjU-UB69JqOWLjG5waiUJBUBGeeRp3V7FBbwaBe3sG1qm7DlPSk": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantEncode)},
|
||||
|
||||
"substitute": {Mode: fs.ModeDir | 0700},
|
||||
|
||||
@@ -104,8 +104,8 @@ func TestTar(t *testing.T) {
|
||||
"checksum/" + wantExpandEncode + "/libedac.so": {Mode: fs.ModeSymlink | 0777, Data: []byte("/proc/nonexistent/libedac.so")},
|
||||
|
||||
"identifier": {Mode: fs.ModeDir | 0700},
|
||||
"identifier/W5S65DEhawz_WKaok5NjUKLmnD9dNl5RPauNJjcOVcB3VM4eGhSaLGmXbL8vZpiw": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantExpandEncode)},
|
||||
"identifier/_v1blm2h-_KA-dVaawdpLas6MjHc6rbhhFS8JWwx8iJxZGUu8EBbRrhr5AaZ9PJL": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantExpandEncode)},
|
||||
"identifier/WbWIIUGl6bqDBsjU-UB69JqOWLjG5waiUJBUBGeeRp3V7FBbwaBe3sG1qm7DlPSk": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantExpandEncode)},
|
||||
"identifier/e3BECw_x_vDyTvj2P48MJVgwpgALeXQ90Ye2Y8gr6SwIPtMup6SR2LVcCTDRGpVi": {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantExpandEncode)},
|
||||
|
||||
"substitute": {Mode: fs.ModeDir | 0700},
|
||||
|
||||
@@ -156,49 +156,6 @@ func checkTarHTTP(
|
||||
"testdata": {Data: []byte(testdata), Mode: 0400},
|
||||
}))
|
||||
|
||||
wantIdent := func() pkg.ID {
|
||||
h := sha512.New384()
|
||||
|
||||
// kind uint64
|
||||
h.Write([]byte{byte(pkg.KindTar), 0, 0, 0, 0, 0, 0, 0})
|
||||
// deps_sz uint64
|
||||
h.Write([]byte{1, 0, 0, 0, 0, 0, 0, 0})
|
||||
|
||||
// kind uint64
|
||||
h.Write([]byte{byte(pkg.KindHTTPGet), 0, 0, 0, 0, 0, 0, 0})
|
||||
// ident ID
|
||||
h0 := sha512.New384()
|
||||
// kind uint64
|
||||
h0.Write([]byte{byte(pkg.KindHTTPGet), 0, 0, 0, 0, 0, 0, 0})
|
||||
// deps_sz uint64
|
||||
h0.Write([]byte{0, 0, 0, 0, 0, 0, 0, 0})
|
||||
// url string
|
||||
h0.Write([]byte{byte(pkg.IRKindString), 0, 0, 0})
|
||||
h0.Write([]byte{0x10, 0, 0, 0})
|
||||
h0.Write([]byte("file:///testdata"))
|
||||
// end(KnownChecksum)
|
||||
h0.Write([]byte{byte(pkg.IRKindEnd), 0, 0, 0})
|
||||
h0.Write([]byte{byte(pkg.IREndKnownChecksum), 0, 0, 0})
|
||||
// checksum Checksum
|
||||
h0.Write(testdataChecksum[:])
|
||||
h.Write(h0.Sum(nil))
|
||||
// compression uint32
|
||||
h.Write([]byte{byte(pkg.IRKindUint32), 0, 0, 0})
|
||||
h.Write([]byte{pkg.TarGzip, 0, 0, 0})
|
||||
// end
|
||||
h.Write([]byte{byte(pkg.IRKindEnd), 0, 0, 0})
|
||||
h.Write([]byte{0, 0, 0, 0})
|
||||
|
||||
return pkg.ID(h.Sum(nil))
|
||||
}()
|
||||
|
||||
a := pkg.NewHTTPGetTar(
|
||||
&client,
|
||||
"file:///testdata",
|
||||
testdataChecksum,
|
||||
pkg.TarGzip,
|
||||
)
|
||||
|
||||
tarDir := stubArtifact{
|
||||
kind: pkg.KindExec,
|
||||
params: []byte("directory containing a single regular file"),
|
||||
@@ -251,27 +208,28 @@ func checkTarHTTP(
|
||||
defer newDestroyArtifactFunc(&tarDirType)(t, base, c)
|
||||
|
||||
cureMany(t, c, []cureStep{
|
||||
{"file", a, base.Append(
|
||||
"identifier",
|
||||
pkg.Encode(wantIdent),
|
||||
), want, nil},
|
||||
{"file", pkg.NewTar(pkg.NewDecompress(pkg.NewHTTPGet(
|
||||
&client,
|
||||
"file:///testdata",
|
||||
testdataChecksum,
|
||||
), pkg.Gzip)), ignorePathname, want, nil},
|
||||
|
||||
{"directory", pkg.NewTar(
|
||||
{"directory", pkg.NewTar(pkg.NewDecompress(
|
||||
&tarDir,
|
||||
pkg.TarGzip,
|
||||
), ignorePathname, want, nil},
|
||||
pkg.Gzip,
|
||||
)), ignorePathname, want, nil},
|
||||
|
||||
{"multiple entries", pkg.NewTar(
|
||||
{"multiple entries", pkg.NewTar(pkg.NewDecompress(
|
||||
&tarDirMulti,
|
||||
pkg.TarGzip,
|
||||
), nil, nil, errors.New(
|
||||
pkg.Gzip,
|
||||
)), nil, nil, errors.New(
|
||||
"input directory does not contain a single regular file",
|
||||
)},
|
||||
|
||||
{"bad type", pkg.NewTar(
|
||||
{"bad type", pkg.NewTar(pkg.NewDecompress(
|
||||
&tarDirType,
|
||||
pkg.TarGzip,
|
||||
), nil, nil, errors.New(
|
||||
pkg.Gzip,
|
||||
)), nil, nil, errors.New(
|
||||
"input directory does not contain a single regular file",
|
||||
)},
|
||||
|
||||
@@ -281,6 +239,6 @@ func checkTarHTTP(
|
||||
cure: func(t *pkg.TContext) error {
|
||||
return stub.UniqueError(0xcafe)
|
||||
},
|
||||
}, pkg.TarGzip), nil, nil, stub.UniqueError(0xcafe)},
|
||||
}), nil, nil, stub.UniqueError(0xcafe)},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user