Merge pull request #23083 from Luap99/restore-hosts

restore: fix missing network setup
This commit is contained in:
openshift-merge-bot[bot]
2024-06-25 11:29:20 +00:00
committed by GitHub
2 changed files with 16 additions and 0 deletions

View File

@@ -247,6 +247,9 @@ function teardown() {
run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname\").MacAddress}}"
mac1="$output"
run_podman exec $cid cat /etc/hosts /etc/resolv.conf
pre_hosts_resolv_conf_output="$output"
run_podman container checkpoint $cid
is "$output" "$cid"
run_podman container restore $cid
@@ -258,6 +261,10 @@ function teardown() {
run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname\").MacAddress}}"
mac2="$output"
# Make sure hosts and resolv.conf are the same after restore (#22901)
run_podman exec $cid cat /etc/hosts /etc/resolv.conf
assert "$output" == "$pre_hosts_resolv_conf_output" "hosts/resolv.conf must be the same after checkpoint"
assert "$ip2" == "$ip1" "ip after restore should match"
assert "$mac2" == "$mac1" "mac after restore should match"