summaryrefslogtreecommitdiff
path: root/test/system/140-diff.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/system/140-diff.bats')
-rw-r--r--test/system/140-diff.bats22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/system/140-diff.bats b/test/system/140-diff.bats
index 01ec5430e..1277f9bbe 100644
--- a/test/system/140-diff.bats
+++ b/test/system/140-diff.bats
@@ -32,4 +32,26 @@ load helpers
run_podman rm $n
}
+@test "podman diff with buildah container " {
+ rand_file=$(random_string 10)
+ buildah from --name buildahctr $IMAGE
+ buildah run buildahctr sh -c "touch /$rand_file;rm /etc/services"
+
+ run_podman diff --format json buildahctr
+
+ # 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
+
+ buildah rm buildahctr
+}
+
# vim: filetype=sh