mirror of
https://github.com/containers/skopeo.git
synced 2025-08-17 14:06:51 +00:00
systemtest: add simple env test in inspect.bats
Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
This commit is contained in:
parent
5ae6b16c0f
commit
8d1bb15075
@ -64,4 +64,19 @@ Os linux
|
|||||||
END_EXPECT
|
END_EXPECT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "inspect: env" {
|
||||||
|
remote_image=docker://docker.io/fedora:latest
|
||||||
|
run_skopeo inspect $remote_image
|
||||||
|
inspect_remote=$output
|
||||||
|
|
||||||
|
# Simple check on 'inspect' output with environment variables.
|
||||||
|
# 1) Get remote image values of environment variables (the value of 'Env')
|
||||||
|
# 2) Confirm substring in check_array and the value of 'Env' match.
|
||||||
|
check_array=(DISTTAG=f[0-9]+container FGC=f[0-9]+ FBR=f[0-9]+)
|
||||||
|
remote=$(echo "$inspect_remote" | jq '.Env[]')
|
||||||
|
for substr in ${check_array[@]}; do
|
||||||
|
expect_output --from="$remote" --substring "$substr"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# vim: filetype=sh
|
# vim: filetype=sh
|
||||||
|
Loading…
Reference in New Issue
Block a user