diff --git a/tests/integration/test_system_containers.sh b/tests/integration/test_system_containers.sh index 73aa05c8..eeb47b9f 100755 --- a/tests/integration/test_system_containers.sh +++ b/tests/integration/test_system_containers.sh @@ -19,7 +19,9 @@ OUTPUT=$(/bin/true) # Skip the test if OSTree or runc are not installed, or atomic has not --install --system ostree --version &>/dev/null || exit 77 runc --version &>/dev/null || exit 77 -${ATOMIC} install --help 2>&1 | grep -q -- --system || exit 77 + +${ATOMIC} install --help 2>&1 > help.out +grep -q -- --system help.out || exit 77 export ATOMIC_OSTREE_REPO=${WORK_DIR}/repo export ATOMIC_OSTREE_CHECKOUT_PATH=${WORK_DIR}/checkout @@ -29,7 +31,8 @@ docker save atomic-test-system > ${WORK_DIR}/atomic-test-system.tar ${ATOMIC} pull dockertar:/${WORK_DIR}/atomic-test-system.tar # Check that the branch is created in the OSTree repository -ostree --repo=${ATOMIC_OSTREE_REPO} refs | grep -q "ociimage/atomic-test-system-latest" +ostree --repo=${ATOMIC_OSTREE_REPO} refs > refs +grep -q "ociimage/atomic-test-system-latest" refs ${ATOMIC} images list > ${WORK_DIR}/images grep -q "atomic-test-system" ${WORK_DIR}/images @@ -53,15 +56,24 @@ trap teardown EXIT ${ATOMIC} --debug install --name=${NAME} --set=RECEIVER=${SECRET} --system oci:atomic-test-system -${ATOMIC} ps | grep -q "test-system" -${ATOMIC} ps --json | grep -q "test-system" -${ATOMIC} ps --all | grep -q "test-system" -${ATOMIC} ps --json --all | grep -q "test-system" -${ATOMIC} ps --filter id=test-system | grep -q "test-system" -${ATOMIC} ps --no-trunc | grep -q "test-system" -${ATOMIC} ps --quiet | grep -q "test-system" -${ATOMIC} ps -aq --no-trunc --filter id=test-system | grep -q "test-system" -if ${ATOMIC} ps -aq --no-trunc --filter id=non-existing-system | grep -q "test-system"; then +${ATOMIC} ps > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps --json > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps --all > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps --json --all > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps --filter id=test-system > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps --no-trunc > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps --quiet > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps -aq --no-trunc --filter id=test-system > ps.out +grep -q "test-system" ps.out +${ATOMIC} ps -aq --no-trunc --filter id=non-existing-system > ps.out +if grep -q "test-system" ps.out; then exit 1 fi @@ -108,9 +120,11 @@ test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.1 ${ATOMIC} pull docker.io/busybox -ostree --repo=${ATOMIC_OSTREE_REPO} refs | grep busybox +ostree --repo=${ATOMIC_OSTREE_REPO} refs > refs +grep -q busybox refs ${ATOMIC} images delete -f busybox -OUTPUT=$(! ostree --repo=${ATOMIC_OSTREE_REPO} refs | grep -c busybox) +ostree --repo=${ATOMIC_OSTREE_REPO} refs > refs +OUTPUT=$(! grep -c busybox refs) if test $OUTPUT \!= 0; then exit 1 fi @@ -121,7 +135,8 @@ ostree --repo=${ATOMIC_OSTREE_REPO} refs | grep busybox ${ATOMIC} images delete -f atomic-test-system ${ATOMIC} images delete -f busybox ${ATOMIC} images prune -OUTPUT=$(! ostree --repo=${ATOMIC_OSTREE_REPO} refs | grep -c ociimage) +ostree --repo=${ATOMIC_OSTREE_REPO} refs > refs +OUTPUT=$(! grep -c ociimage refs) if test $OUTPUT \!= 0; then exit 1 fi