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

Commit

Permalink
iQIcBAABAgAGBQJXl4H/AAoJECY9bfLhY+HqXgkP+wU167QAB7wlhi4qbu5zTFuw
Browse files Browse the repository at this point in the history
 6hullNIF7T05ZA5X1UyOWRiHxvN6g97jM5e9wGPYKvVgvEg655zgn+9S4SK4cerF
 Nce1hmsyZCPGtJ6JNC8LvJv732zfGOLt2VwZkcHmXOG8JEY5qYo8qa+4f7y/MwFK
 HhXttSNLi7kIkaiXiynob2jj2IZkfcNJWRJL7QDIyBceJlG/sD7xeDh80qUO5O4j
 KLOAHCQfdAcHO3ffK1YC57Z4vpibrJbbsOWmeBkT3YM7jGcPfAoGWUHfsMU348Kj
 7a/NnYUw8xDqI/kdMZbefGckc3+dpFB2k1PJUVqafaOQil3z1eqh7LpZjnmB+Ejv
 i3iHaJEGBnpSbBlc9FsZk0RP70qtddFPefY1Z2xj//zVaiJoMq7BdglwBe6qZtTN
 29bU+F0ClYEVRJ+bhqCKfjY7eAcFBAfxK0FI1TDWuBQgAPREshH7O9ozZBfL0bOa
 NyRMyqvn3Zq/e2rOc5AmSdlRkyxjgKyXQEM6Li7lvkbDzedMRCpPmt7A9eSfqgCg
 nQ33+CL8cuJk9NypcFTomzPeFxn4WA1wqjstS1YEkrISyNA290e5G5V8wnrw5yQS
 k80lUhtgd5mfFbl2QMshzCtVdm1f+p3QKhZh0Au596U99UQWA4iidbmXsVYSqq/8
 YQNPmggAAU8ZHI8Psdxd
 =S/+v
 -----END PGP SIGNATURE-----

tests: write to file before using grep

It avoids some random SIGPIPEs during the tests

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #497
Approved by: jlebon
  • Loading branch information
giuseppe authored and rh-atomic-bot committed Jul 26, 2016
1 parent b639eb3 commit 4620f9f
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions tests/integration/test_system_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 4620f9f

Please sign in to comment.