forked from eclipse-kanto/container-management
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eclipse-kanto#118] Provide integration test for the CLI get command
Created golden file and test case scenarios, created an init function and an add fuction for the customResultFns map and unmarshaled the data. Signed-off-by: Daniel Milchev <fixed-term.daniel.milchev@bosch.io>
- Loading branch information
1 parent
f4bc857
commit d5b855f
Showing
4 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: get_help | ||
command: | ||
binary: kanto-cm | ||
args: ["get", "-h"] | ||
expected: | ||
exitCode: 0 | ||
goldenFile: "get-help.golden" | ||
--- | ||
name: get_no_args | ||
command: | ||
binary: kanto-cm | ||
args: ["get"] | ||
expected: | ||
exitCode: 1 | ||
err: "Error: You must provide either an ID or a name for the container via --name (-n)" | ||
--- | ||
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." | ||
--- | ||
name: get_container | ||
setupCmd: | ||
- binary: kanto-cm | ||
args: ["create", "--host", "$KANTO_HOST", "-n", "get_container", "docker.io/library/influxdb:1.8.4"] | ||
command: | ||
binary: kanto-cm | ||
args: ["get", "-n", "get_container"] | ||
expected: | ||
exitCode: 0 | ||
customResult: | ||
type: ASSERT_JSON_CONTAINER | ||
args: [] | ||
onExit: | ||
- binary: "kanto-cm" | ||
args: ["remove", "--host", "$KANTO_HOST", "-n", "get_container", "-f"] |