Skip to content

Commit

Permalink
test: Update the cli gingko test
Browse files Browse the repository at this point in the history
This commit is to update the cli test cases for help command

Originally, help command output is printing to stderr instead of stdout.
This commit might be reverted if it's not agreed by maintainer

Signed-off-by: Tam Mach <sayboras@yahoo.com>
  • Loading branch information
sayboras authored and qmonnet committed May 3, 2020
1 parent e4d203d commit 4a2a873
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/runtime/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,22 @@ var _ = Describe("RuntimeCLI", func() {

Context("stdout stderr testing", func() {

It("root command help should print to stderr", func() {
It("root command help should print to stdout", func() {
res := vm.ExecCilium("help")
Expect(res.GetStdOut()).Should(BeEmpty())
Expect(res.GetStdErr()).Should(ContainSubstring("Use \"cilium [command] --help\" for more information about a command."))
Expect(res.GetStdErr()).Should(BeEmpty())
Expect(res.GetStdOut()).Should(ContainSubstring("Use \"cilium [command] --help\" for more information about a command."))
})

It("subcommand help should print to stderr", func() {
It("subcommand help should print to stdout", func() {
res := vm.ExecCilium("help bpf")
Expect(res.GetStdOut()).Should(BeEmpty())
Expect(res.GetStdErr()).Should(ContainSubstring("Use \"cilium bpf [command] --help\" for more information about a command."))
Expect(res.GetStdErr()).Should(BeEmpty())
Expect(res.GetStdOut()).Should(ContainSubstring("Use \"cilium bpf [command] --help\" for more information about a command."))
})

It("failed subcommand should print help to stderr", func() {
It("failed subcommand should print help to stdout", func() {
res := vm.ExecCilium("endpoint confi 173")
Expect(res.GetStdOut()).Should(BeEmpty())
Expect(res.GetStdErr()).Should(ContainSubstring("Use \"cilium endpoint [command] --help\" for more information about a command."))
Expect(res.GetStdErr()).Should(BeEmpty())
Expect(res.GetStdOut()).Should(ContainSubstring("Use \"cilium endpoint [command] --help\" for more information about a command."))
})

})
Expand Down

0 comments on commit 4a2a873

Please sign in to comment.