server/sandbox: fix add/release pod/ctr ids and names

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-10-13 10:50:51 +02:00
parent e999610fd6
commit 8a9395964e
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
3 changed files with 78 additions and 8 deletions

View file

@ -108,3 +108,37 @@ function teardown() {
cleanup_pods
stop_ocid
}
# regression test for #127
@test "ctrs status for a pod" {
# this test requires docker, thus it can't yet be run in a container
if [ "$TRAVIS" = "true" ]; then # instead of $TRAVIS, add a function is_containerized to skip here
skip "cannot yet run this test in a container, use sudo make localintegration"
fi
start_ocid
run ocic pod create --config "$TESTDATA"/sandbox_config.json
echo "$output"
[ "$status" -eq 0 ]
pod_id="$output"
run ocic ctr create --config "$TESTDATA"/container_redis.json --pod "$pod_id"
echo "$output"
[ "$status" -eq 0 ]
run ocic ctr list --quiet
echo "$output"
[ "$status" -eq 0 ]
[[ "${output}" != "" ]]
printf '%s\n' "$output" | while IFS= read -r id
do
run ocic ctr status --id "$id"
echo "$output"
[ "$status" -eq 0 ]
done
cleanup_ctrs
cleanup_pods
stop_ocid
}

View file

@ -30,13 +30,13 @@ function teardown() {
echo "$output"
[ "$status" -eq 0 ]
[[ "${output}" != "" ]]
[[ "${output}" =~ "${pod_id}" ]]
[[ "${output}" =~ "${pod_id}" ]]
run ocic ctr list
echo "$output"
[ "$status" -eq 0 ]
[[ "${output}" != "" ]]
[[ "${output}" =~ "${pod_id}" ]]
[[ "${output}" =~ "${pod_id}" ]]
cleanup_ctrs
cleanup_pods