Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
tests: write to file before of using grep
Browse files Browse the repository at this point in the history
It avoids some random sigpipes during the tests

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jul 22, 2016
1 parent 7b77e74 commit 233d8ad
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions tests/integration/test_system_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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
Expand All @@ -53,10 +54,14 @@ 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 > 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

test -e /etc/systemd/system/${NAME}.service

Expand Down Expand Up @@ -101,9 +106,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
Expand All @@ -114,7 +121,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

0 comments on commit 233d8ad

Please sign in to comment.