MCPcopy
hub / github.com/apptainer/apptainer / testNoninteractiveCacheCmds

Method testNoninteractiveCacheCmds

e2e/cache/cache.go:62–161  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func (c cacheTests) testNoninteractiveCacheCmds(t *testing.T) {
63 tests := []struct {
64 name string
65 options []string
66 needImage bool
67 expectedEmptyCache bool
68 expectedOutput string
69 exit int
70 }{
71 {
72 name: "clean force",
73 options: []string{"clean", "--force"},
74 expectedOutput: "",
75 needImage: true,
76 expectedEmptyCache: true,
77 exit: 0,
78 },
79 {
80 name: "clean force days beyond age",
81 options: []string{"clean", "--force", "--days", "30"},
82 expectedOutput: "",
83 needImage: true,
84 expectedEmptyCache: false,
85 exit: 0,
86 },
87 {
88 name: "clean force days within age",
89 options: []string{"clean", "--force", "--days", "0"},
90 expectedOutput: "",
91 needImage: true,
92 expectedEmptyCache: true,
93 exit: 0,
94 },
95 {
96 name: "clean help",
97 options: []string{"clean", "--help"},
98 expectedOutput: "Clean your local Apptainer cache",
99 needImage: false,
100 exit: 0,
101 },
102 {
103 name: "list help",
104 options: []string{"list", "--help"},
105 expectedOutput: "List your local Apptainer cache",
106 needImage: false,
107 exit: 0,
108 },
109 {
110 name: "list type",
111 options: []string{"list", "--type", "net"},
112 needImage: true,
113 expectedOutput: "There are 1 container file",
114 expectedEmptyCache: false,
115 exit: 0,
116 },
117 {
118 name: "list verbose",
119 needImage: true,

Callers

nothing calls this directly

Calls 11

MakeTempDirFunction · 0.92
MakeCacheDirFunction · 0.92
NewFunction · 0.92
AsSubtestFunction · 0.92
WithProfileFunction · 0.92
WithCommandFunction · 0.92
WithArgsFunction · 0.92
ExpectExitFunction · 0.92
prepTestFunction · 0.85
ensureNotCachedFunction · 0.85
RunApptainerMethod · 0.80

Tested by

no test coverage detected