Skip to content

Commit 33f097a

Browse files
committed
test rm{,i,p} subcommands help message
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
1 parent 00ae824 commit 33f097a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

test/e2e/help_test.go

+41
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package e2e
1818

1919
import (
2020
. "github.com/onsi/ginkgo/v2"
21+
. "github.com/onsi/gomega/gexec"
2122
)
2223

2324
// The actual test suite
@@ -42,3 +43,43 @@ var _ = t.Describe("help", func() {
4243
"flag provided but not defined")
4344
})
4445
})
46+
47+
// The actual test suite
48+
var _ = t.Describe("help subcommand", func() {
49+
50+
var (
51+
endpoint, testDir string
52+
crio *Session
53+
)
54+
BeforeEach(func() {
55+
endpoint, testDir, crio = t.StartCrio()
56+
})
57+
58+
AfterEach(func() {
59+
t.StopCrio(testDir, crio)
60+
})
61+
62+
It("should show help running rm with params", func() {
63+
t.CrictlExpectSuccessWithEndpoint(endpoint, "rm", "crictl rm command")
64+
})
65+
66+
It("should show help running rmi with params", func() {
67+
t.CrictlExpectSuccessWithEndpoint(endpoint, "rmi", "crictl rmi command")
68+
})
69+
70+
It("should show help running rmp with params", func() {
71+
t.CrictlExpectSuccessWithEndpoint(endpoint, "rmp", "crictl rmp command")
72+
})
73+
74+
It("should not show help running rm -a", func() {
75+
t.CrictlExpectSuccessWithEndpoint(endpoint, "rm -a", "No containers to remove")
76+
})
77+
78+
It("should not show help running rmi -a", func() {
79+
t.CrictlExpectSuccessWithEndpoint(endpoint, "rmi -a", "No images to remove")
80+
})
81+
82+
It("should not show help running rmp -a", func() {
83+
t.CrictlExpectSuccessWithEndpoint(endpoint, "rmp -a", "No pods to remove")
84+
})
85+
})

0 commit comments

Comments
 (0)