summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-06-27 13:45:08 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-29 09:21:33 +0000
commitc09bbe8e068cb0648242a9345f2f22a6d1db90e0 (patch)
tree5fe77c4eacd7aa5dc7e2a51a35c988ba015394d2 /test
parentc9eddd22ebce7e139c2eda5c50525fa1ca8268de (diff)
downloadpodman-c09bbe8e068cb0648242a9345f2f22a6d1db90e0.tar.gz
podman-c09bbe8e068cb0648242a9345f2f22a6d1db90e0.tar.bz2
podman-c09bbe8e068cb0648242a9345f2f22a6d1db90e0.zip
Test to verify overlay quotas work, show container overhead on quota
Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1013 Approved by: rhatdan
Diffstat (limited to 'test')
-rwxr-xr-x[-rw-r--r--]test/test_podman_baseline.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh
index 59bcb0e84..144314358 100644..100755
--- a/test/test_podman_baseline.sh
+++ b/test/test_podman_baseline.sh
@@ -194,3 +194,51 @@ podman run whale-says
podman rm --all
podman rmi --all
rm ./Dockerfile
+
+########
+# Set up xfs mount for overlay quota
+########
+
+# 1.004608 MB is 1,004,608 bytes. The container overhead is 4608 bytes (or 9 512 byte pages), so this allocates 1 MB of usable storage
+PODMANBASE="-s overlay --storage-opt overlay.size=1.004608M --root /tmp/podman_test/crio"
+TMPDIR=/tmp/podman_test
+mkdir $TMPDIR
+dd if=/dev/zero of=$TMPDIR/virtfs bs=1024 count=30720
+device=$(losetup -f | tr -d '[:space:]')
+losetup $device $TMPDIR/virtfs
+mkfs.xfs $device
+mount -t xfs -o prjquota $device $TMPDIR
+
+
+########
+# Expected to succeed
+########
+podman $PODMANBASE run --security-opt label=disable alpine sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048576 bs=1'
+rc=$?
+if [ $rc == 0 ];
+then
+ echo "Overlay test within limits passed"
+else
+ echo "Overlay test within limits failed"
+fi
+
+########
+# Expected to fail
+########
+podman $PODMANBASE run --security-opt label=disable alpine sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048577 bs=1'
+rc=$?
+if [ $rc != 0 ];
+then
+ echo "Overlay test outside limits passed"
+else
+ echo "Overlay test outside limits failed"
+fi
+
+########
+# Clean up Podman and /tmp
+########
+podman rm --all
+podman rmi --all
+umount $TMPDIR -l
+losetup -d $device
+rm -rf /tmp/podman_test