diff --git a/tests/integration/tier1/destructive/error-after-ponr/test_error_after_ponr.py b/tests/integration/tier1/destructive/error-after-ponr/test_error_after_ponr.py index ebb3121f4b..f6adc84455 100644 --- a/tests/integration/tier1/destructive/error-after-ponr/test_error_after_ponr.py +++ b/tests/integration/tier1/destructive/error-after-ponr/test_error_after_ponr.py @@ -8,6 +8,7 @@ def test_error_after_ponr(convert2rhel, shell): This test destroys the machine so neither reboot nor any checks after conversion are called """ + assert shell("yum install dnsmasq -y").returncode == 0 with convert2rhel( "-y --serverurl {} --username {} --password {} --debug".format( TEST_VARS["RHSM_SERVER_URL"], @@ -15,11 +16,18 @@ def test_error_after_ponr(convert2rhel, shell): TEST_VARS["RHSM_SCA_PASSWORD"], ) ) as c2r: - # Wait until "Replace system packages" task to cause the failure - # This will prevent yum restoring the original configuration - c2r.expect("CONVERT_SYSTEM_PACKAGES has succeeded") + # Wait until Point of no return appears. Then block all the internet connection + c2r.expect_exact("WARNING - The tool allows rollback of any action until this point.") + c2r.expect_exact("Convert: Replace system packages") - assert shell('echo "proxy=localhost" >> /etc/yum.conf').returncode == 0 + # Everything is resolved to localhost + with open("/etc/dnsmasq.conf", "a") as f: + f.write("address=/#/127.0.0.1") + + with open("/etc/resolv.conf", "w") as f: + f.write("nameserver 127.0.0.1") + + assert shell("systemctl enable dnsmasq && systemctl restart dnsmasq").returncode == 0 c2r.expect("WARNING - The conversion process failed") c2r.expect( @@ -29,4 +37,4 @@ def test_error_after_ponr(convert2rhel, shell): "It is strongly recommended to store the Convert2RHEL logs for later investigation, and restore the system from a backup" ) - assert c2r.exitstatus == 1 + assert c2r.exitstatus == 2