diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-15 23:33:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-15 23:33:02 +0100 |
commit | 0870e88ff48eaf6b5624044b7cd2bc35cff85150 (patch) | |
tree | e0cd9d15cda69ffa8818cb84a5554ee48f41ca29 /test/system/140-diff.bats | |
parent | 978b891c8d2ffa7d52d872625a9ce3816c90334c (diff) | |
parent | 1298f19773574963b9ce5ba7ca3b1637d1a07ef6 (diff) | |
download | podman-0870e88ff48eaf6b5624044b7cd2bc35cff85150.tar.gz podman-0870e88ff48eaf6b5624044b7cd2bc35cff85150.tar.bz2 podman-0870e88ff48eaf6b5624044b7cd2bc35cff85150.zip |
Merge pull request #4824 from edsantiago/bats
more BATS tests
Diffstat (limited to 'test/system/140-diff.bats')
-rw-r--r-- | test/system/140-diff.bats | 28 |
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 |