bats: Add a test for adding device to a container
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
parent
4a02418c82
commit
d3c7a24896
1 changed files with 25 additions and 0 deletions
|
@ -429,6 +429,31 @@ function teardown() {
|
||||||
stop_ocid
|
stop_ocid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "ctr device add" {
|
||||||
|
start_ocid
|
||||||
|
run ocic pod run --config "$TESTDATA"/sandbox_config.json
|
||||||
|
echo "$output"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
pod_id="$output"
|
||||||
|
run ocic ctr create --config "$TESTDATA"/container_redis_device.json --pod "$pod_id"
|
||||||
|
echo "$output"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
ctr_id="$output"
|
||||||
|
run ocic ctr start --id "$ctr_id"
|
||||||
|
echo "$output"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
run ocic ctr execsync --id "$ctr_id" ls /dev/mynull
|
||||||
|
echo "$output"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ "$output" =~ "/dev/mynull" ]]
|
||||||
|
run ocic pod remove --id "$pod_id"
|
||||||
|
echo "$output"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
cleanup_ctrs
|
||||||
|
cleanup_pods
|
||||||
|
stop_ocid
|
||||||
|
}
|
||||||
|
|
||||||
@test "ctr execsync failure" {
|
@test "ctr execsync failure" {
|
||||||
start_ocid
|
start_ocid
|
||||||
run ocic pod run --config "$TESTDATA"/sandbox_config.json
|
run ocic pod run --config "$TESTDATA"/sandbox_config.json
|
||||||
|
|
Loading…
Reference in a new issue