summaryrefslogtreecommitdiff
path: root/test/system/140-diff.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-12-23 05:43:08 -0700
committerEd Santiago <santiago@redhat.com>2020-01-13 06:29:52 -0700
commit1298f19773574963b9ce5ba7ca3b1637d1a07ef6 (patch)
tree69367bb8637056113e793d812c70af9c4f5a62d9 /test/system/140-diff.bats
parent9e2e4d7615311b38b1e553af32a5666888ef3c96 (diff)
downloadpodman-1298f19773574963b9ce5ba7ca3b1637d1a07ef6.tar.gz
podman-1298f19773574963b9ce5ba7ca3b1637d1a07ef6.tar.bz2
podman-1298f19773574963b9ce5ba7ca3b1637d1a07ef6.zip
more BATS tests
- run: --name (includes 'podman container exists' tests) - run: --pull (always, never, missing) - build: new test for ADD URL (#4420) - exec: new test for issue #4785 (pipe getting lost) - diff: new test - selinux (mostly copied from docker-autotest) Plus a bug fix: the wait_for_output() helper would continue checking, eventually timing out, even if the container had already exited (probably because of an error). Fix: as part of the loop, run 'podman inspect' and bail out if container is not running. Include exit code and logs. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/140-diff.bats')
-rw-r--r--test/system/140-diff.bats28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/system/140-diff.bats b/test/system/140-diff.bats
new file mode 100644
index 000000000..9f4a2c0de
--- /dev/null
+++ b/test/system/140-diff.bats
@@ -0,0 +1,28 @@
+#!/usr/bin/env bats -*- bats -*-
+#
+# Tests for podman diff
+#
+
+load helpers
+
+@test "podman diff" {
+ rand_file=$(random_string 10)
+ run_podman run $IMAGE sh -c "touch /$rand_file;rm /etc/services"
+ run_podman diff --format json -l
+
+ # Expected results for each type of diff
+ declare -A expect=(
+ [added]="/$rand_file"
+ [changed]="/etc"
+ [deleted]="/etc/services"
+ )
+
+ for field in ${!expect[@]}; do
+ result=$(jq -r -c ".${field}[]" <<<"$output")
+ is "$result" "${expect[$field]}" "$field"
+ done
+
+ run_podman rm -l
+}
+
+# vim: filetype=sh