diff --git a/test/system/750-trust.bats b/test/system/750-trust.bats index 06a2526d0..f06df35e7 100644 --- a/test/system/750-trust.bats +++ b/test/system/750-trust.bats @@ -9,25 +9,33 @@ load helpers skip_if_remote "trust only works locally" policypath=$PODMAN_TMPDIR/policy.json run_podman 125 image trust set --policypath=$policypath --type=bogus default + is "$output" "Error: invalid choice: bogus.*" "error from --type=bogus" run_podman image trust set --policypath=$policypath --type=accept default run_podman image trust show --policypath=$policypath - is "$output" ".*accept" "output should show accept" + is "$output" ".*all *default *accept" "default policy should be accept" run_podman image trust set --policypath=$policypath --type=reject default run_podman image trust show --policypath=$policypath - is "$output" ".*reject" "output should show reject" + is "$output" ".*all *default *reject" "default policy should be reject" run_podman image trust set --policypath=$policypath --type=reject docker.io run_podman image trust show --policypath=$policypath - is "$output" ".*docker.io" "output should show docker.io" + is "$output" ".*all *default *reject" "default policy should still be reject" + is "$output" ".*repository *docker.io *reject" "docker.io should also be reject" run_podman image trust show --policypath=$policypath --json - is "$output" ".*docker.io.*reject" "output should show docker.io" + subset=$(jq -r '.[0] | .repo_name, .type' <<<"$output" | fmt) + is "$subset" "default reject" "--json also shows default" + subset=$(jq -r '.[1] | .repo_name, .type' <<<"$output" | fmt) + is "$subset" "docker.io reject" "--json also shows docker.io" run_podman image trust set --policypath=$policypath --type=accept docker.io run_podman image trust show --policypath=$policypath --json - is "$output" ".*docker.io.*accept" "output should show docker.io" + subset=$(jq -r '.[0] | .repo_name, .type' <<<"$output" | fmt) + is "$subset" "default reject" "--json, default is still reject" + subset=$(jq -r '.[1] | .repo_name, .type' <<<"$output" | fmt) + is "$subset" "docker.io accept" "--json, docker.io should now be accept" run cat $policypath policy=$output