diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-19 02:49:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 02:49:27 -0400 |
commit | 7ffcab0854342844a44b2668bd9d98849bf935c8 (patch) | |
tree | c7c8b60c8d389314309c7e2e73e3b41f06988fbc /test/system/140-diff.bats | |
parent | 6ec96dc009d73cc2b0a3fa81149ca599b04252e4 (diff) | |
parent | 571ae9db7241ffbe1be4f254328cfd2e43369103 (diff) | |
download | podman-7ffcab0854342844a44b2668bd9d98849bf935c8.tar.gz podman-7ffcab0854342844a44b2668bd9d98849bf935c8.tar.bz2 podman-7ffcab0854342844a44b2668bd9d98849bf935c8.zip |
Merge pull request #7908 from rhatdan/diff
fix podman container exists and diff for storage containers
Diffstat (limited to 'test/system/140-diff.bats')
-rw-r--r-- | test/system/140-diff.bats | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/system/140-diff.bats b/test/system/140-diff.bats index 01ec5430e..d0f33e438 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) + run buildah from --name buildahctr $IMAGE + run 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 + + run buildah rm buildahctr +} + # vim: filetype=sh |