1e2232762c
The tests introduced by commit b5cdc57ae3
have proven to be
rather unstable due to mistakes in their design. The tests were quite
chaotically structured, and because of that images were deleted and
pulled too often, causing several false positives [1, 2].
This changes the structure of the tests in a major way. The tests
(resp. commands) are now run in a manner that better simulates the way
Toolbox is actually used. From a clean state, through creating
containers, using them and in the end deleting them. This should
reduce the strain on the bandwidth and possibly even speed up the
tests themselves.
[1] https://github.com/containers/toolbox/pull/372
[2] https://github.com/containers/toolbox/pull/374
https://github.com/containers/toolbox/pull/375
23 lines
748 B
Bash
23 lines
748 B
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
@test "Echo 'Hello World' inside of the default container" {
|
|
run_toolbox run echo "Hello World"
|
|
is "$output" "Hello World" "Should say 'Hello World'"
|
|
}
|
|
|
|
@test "Echo 'Hello World' inside of the 'running' container" {
|
|
run_toolbox run -c running echo "Hello World"
|
|
is "$output" "Hello World" "Should say 'Hello World'"
|
|
}
|
|
|
|
@test "Stop the 'running' container using 'podman stop'" {
|
|
run_podman stop running
|
|
is "${#lines[@]}" "1" "Expected number of lines of the output is 1 (with the id of the container)"
|
|
}
|
|
|
|
@test "Echo 'hello World' again in the 'running' container after being stopped and exit" {
|
|
run_toolbox run -c running echo "Hello World"
|
|
is "$output" "Hello World" "Should say 'Hello World'"
|
|
}
|