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 <e.champetier@ateme.com>
  • Loading branch information
champtar committed Apr 29, 2023
1 parent 00ae824 commit 33f097a
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 with params", func() {
t.CrictlExpectSuccessWithEndpoint(endpoint, "rm", "crictl rm command")
})

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

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

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

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

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

0 comments on commit 33f097a

Please sign in to comment.