test: suggests sudo make localintegration

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-09-27 10:54:16 +02:00
parent 560b0a6a9b
commit 77c40487de
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
3 changed files with 18 additions and 13 deletions

View file

@ -76,23 +76,24 @@ function start_ocid() {
function cleanup_pods() { function cleanup_pods() {
run ocic pod list run ocic pod list
[ "$status" -eq 0 ] if [ "$status" -eq 0 ]; then
printf '%s\n' "$output" | while IFS= read -r line printf '%s\n' "$output" | while IFS= read -r line
do do
pod=$(echo "$line" | sed -e 's/ID: //g') pod=$(echo "$line" | sed -e 's/ID: //g')
ocic pod stop --id "$pod" ocic pod stop --id "$pod"
sleep 1 sleep 1
ocic pod remove --id "$pod" ocic pod remove --id "$pod"
done done
fi
} }
# Stop ocid. # Stop ocid.
function stop_ocid() { function stop_ocid() {
kill "$OCID_PID" if [ "$OCID_PID" != "" ]; then
kill "$OCID_PID" >/dev/null 2>&1
fi
} }
function cleanup_test() { function cleanup_test() {
cleanup_pods
stop_ocid
rm -rf "$TESTDIR" rm -rf "$TESTDIR"
} }

View file

@ -8,8 +8,9 @@ function teardown() {
# PR#59 # PR#59
@test "pod release name on remove" { @test "pod release name on remove" {
if "$TRAVIS"; then # this test requires docker, thus it can't yet be run in a container
skip "cannot yet run this test 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 fi
start_ocid start_ocid
@ -24,4 +25,6 @@ function teardown() {
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
run ocic pod create --config "$TESTDATA"/sandbox_config.json run ocic pod create --config "$TESTDATA"/sandbox_config.json
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
stop_ocid
cleanup_pods
} }

View file

@ -10,4 +10,5 @@ function teardown() {
start_ocid start_ocid
ocic runtimeversion ocic runtimeversion
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
stop_ocid
} }