Skip to content

Commit

Permalink
[eclipse-kanto#118] Provide integration test for the CLI get command
Browse files Browse the repository at this point in the history
Created golden file and test case scenarios with exit code 1.

Signed-off-by: Daniel Milchev <fixed-term.daniel.milchev@bosch.io>
  • Loading branch information
daniel-milchev committed Feb 7, 2023
1 parent 4108c97 commit 156d6f1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions integration/testdata/get-help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Get detailed information about a given container.

Usage:
kanto-cm get <container-id>

Examples:
get <container-id>
get --name <container-name>
get -n <container-name>

Flags:
-h, --help help for get
-n, --name string Get the information about a container with a specific name.

Global Flags:
--debug Switch commands log level to DEBUG mode
--host string Specify the address path to the Eclipse Kanto container management (default "/run/container-management/container-management.sock")
--timeout int Specify the connection timeout in seconds to the Eclipse Kanto container management (default 30)
23 changes: 23 additions & 0 deletions integration/testdata/get-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: get_help
command:
binary: kanto-cm
args: ["get", "-h"]
expected:
exitCode: 0
goldenFile: "get-help.golden"
---
name: get_invalid_id
command:
binary: kanto-cm
args: ["get", "invalid"]
expected:
exitCode: 1
err: "Error: The requested container with ID = invalid was not found"
---
name: get_invalid_name
command:
binary: kanto-cm
args: ["get", "-n", "invalid"]
expected:
exitCode: 1
err: "Error: The requested container with name = invalid was not found. Try using an ID instead."

0 comments on commit 156d6f1

Please sign in to comment.