From d621c53cc1ad96adb36612e6143691dd0c79362b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 28 Sep 2026 12:27:34 +0900 Subject: pkg: archive extract helper This exposes the behaviour of curing an archiveArtifact without requiring a cache. This can be handy and avoids lots of duplicate code. Signed-off-by: Ophestra --- pkg/pkg_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/pkg_test.go') diff --git a/pkg/pkg_test.go b/pkg/pkg_test.go index 2d5fdf8e..66639b5b 100644 --- a/pkg/pkg_test.go +++ b/pkg/pkg_test.go @@ -740,6 +740,16 @@ func newWantScrubError(base *check.Absolute) *pkg.ScrubError { } } +// dropFaults removes all fault entries from a cache under testing. +func dropFaults(t *testing.T, base *check.Absolute) { + fault := base.Append("fault") + if err := os.RemoveAll(fault.String()); err != nil { + t.Fatal(err) + } else if err = os.Mkdir(fault.String(), 0); err != nil { + t.Fatal(err) + } +} + func TestCache(t *testing.T) { t.Parallel() -- cgit v1.3.1