MCPcopy
hub / github.com/apptainer/apptainer / testPluginBasic

Method testPluginBasic

e2e/plugin/plugin.go:25–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func (c ctx) testPluginBasic(t *testing.T) {
26 pluginName := "github.com/apptainer/apptainer/e2e-plugin"
27
28 // plugin code directory
29 pluginDir, cleanup := e2e.MakeTempDir(t, "testdata", "e2e-plugin-dir-", "")
30 defer cleanup(t)
31
32 // plugin sif file
33 sifFile := filepath.Join(pluginDir, "plugin.sif")
34
35 tests := []struct {
36 name string
37 profile e2e.Profile
38 command string
39 args []string
40 expectExit int
41 expectOp e2e.ApptainerCmdResultOp
42 }{
43 {
44 name: "Create",
45 profile: e2e.UserProfile,
46 command: "plugin create",
47 args: []string{pluginDir, pluginName},
48 expectExit: 0,
49 },
50 {
51 name: "ListNoPlugins",
52 profile: e2e.UserProfile,
53 command: "plugin list",
54 args: []string{},
55 expectExit: 0,
56 expectOp: e2e.ExpectOutput(e2e.ExactMatch, "There are no plugins installed."),
57 },
58 {
59 name: "Compile",
60 profile: e2e.UserProfile,
61 command: "plugin compile",
62 args: []string{"--out", sifFile, pluginDir},
63 expectExit: 0,
64 },
65 {
66 name: "Install",
67 profile: e2e.RootProfile,
68 command: "plugin install",
69 args: []string{sifFile},
70 expectExit: 0,
71 },
72 {
73 name: "InstallAsUser",
74 profile: e2e.UserProfile,
75 command: "plugin install",
76 args: []string{sifFile},
77 expectExit: 255,
78 },
79 {
80 name: "ListAfterInstall",
81 profile: e2e.UserProfile,
82 command: "plugin list",

Callers

nothing calls this directly

Calls 10

MakeTempDirFunction · 0.92
ExpectOutputFunction · 0.92
AsSubtestFunction · 0.92
WithProfileFunction · 0.92
WithCommandFunction · 0.92
WithArgsFunction · 0.92
ExpectExitFunction · 0.92
GetStreamsFunction · 0.92
RunApptainerMethod · 0.80
LogfMethod · 0.45

Tested by

no test coverage detected