test: add a test for /etc/resolv.conf in rw/ro mode
This patch isn't adding a test for /etc/hosts as that requires host network and we don't want to play with host's /etc/hosts when running make localintegration on our laptops. That may change in the future moving to some sort of in-container testing. Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
2014f0e14f
commit
8b4e3036ea
5 changed files with 188 additions and 7 deletions
|
@ -695,7 +695,7 @@ function teardown() {
|
|||
run crioctl ctr start --id "$ctr_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
# Wait for container to OOM
|
||||
# Wait for container to OOM
|
||||
run sleep 10
|
||||
run crioctl ctr status --id "$ctr_id"
|
||||
echo "$output"
|
||||
|
@ -711,3 +711,42 @@ function teardown() {
|
|||
cleanup_pods
|
||||
stop_crio
|
||||
}
|
||||
|
||||
@test "ctr /etc/resolv.conf rw/ro mode" {
|
||||
start_crio
|
||||
run crioctl pod run --config "$TESTDATA"/sandbox_config.json
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
pod_id="$output"
|
||||
run crioctl ctr create --config "$TESTDATA"/container_config_resolvconf.json --pod "$pod_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
ctr_id="$output"
|
||||
run crioctl ctr start --id "$ctr_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run crioctl ctr status --id "$ctr_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "Status: CONTAINER_EXITED" ]]
|
||||
[[ "$output" =~ "Exit Code: 0" ]]
|
||||
[[ "$output" =~ "Reason: Completed" ]]
|
||||
|
||||
run crioctl ctr create --name roctr --config "$TESTDATA"/container_config_resolvconf_ro.json --pod "$pod_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
ctr_id="$output"
|
||||
run crioctl ctr start --id "$ctr_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run crioctl ctr status --id "$ctr_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "Status: CONTAINER_EXITED" ]]
|
||||
[[ "$output" =~ "Exit Code: 1" ]]
|
||||
[[ "$output" =~ "Reason: Error" ]]
|
||||
|
||||
cleanup_ctrs
|
||||
cleanup_pods
|
||||
stop_crio
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue