@@ -18,6 +18,7 @@ package e2e
18
18
19
19
import (
20
20
. "github.com/onsi/ginkgo/v2"
21
+ . "github.com/onsi/gomega/gexec"
21
22
)
22
23
23
24
// The actual test suite
@@ -42,3 +43,43 @@ var _ = t.Describe("help", func() {
42
43
"flag provided but not defined" )
43
44
})
44
45
})
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