Skip to content

Commit

Permalink
test rm{,i,p} subcommands help message
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne Champetier <[email protected]>
  • Loading branch information
champtar committed May 1, 2023
1 parent 13dbe21 commit dadffe3
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/e2e/help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package e2e

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega/gexec"
)

// The actual test suite
Expand All @@ -42,3 +43,43 @@ var _ = t.Describe("help", func() {
"flag provided but not defined")
})
})

// The actual test suite
var _ = t.Describe("help subcommand", func() {

var (
endpoint, testDir string
crio *Session
)
BeforeEach(func() {
endpoint, testDir, crio = t.StartCrio()
})

AfterEach(func() {
t.StopCrio(testDir, crio)
})

It("should show help running rm without params", func() {
t.CrictlExpectSuccessWithEndpoint(endpoint, "rm", "crictl rm command")
})

It("should show help running rmi without params", func() {
t.CrictlExpectSuccessWithEndpoint(endpoint, "rmi", "crictl rmi command")
})

It("should show help running rmp without params", func() {
t.CrictlExpectSuccessWithEndpoint(endpoint, "rmp", "crictl rmp command")
})

It("should not show help running rm -a", func() {
t.CrictlExpect(endpoint, "rm -a", 0, "", "No containers to remove")
})

It("should not show help running rmi -a", func() {
t.CrictlExpect(endpoint, "rmi -a", 0, "", "No images to remove")
})

It("should not show help running rmp -a", func() {
t.CrictlExpect(endpoint, "rmp -a", 0, "", "No pods to remove")
})
})

0 comments on commit dadffe3

Please sign in to comment.