#9944 Test failure in test_integration/test_dns.py::TestDNSMisc::test_allow_query_transfer_ipv6
Closed: fixed by sumenon. Opened by frenaud.

Issue

The test test_integration/test_dns.py::TestDNSMisc is a new test added with commit bf12c48.
When executed in IDM-CI it fails because IPv6 is not enabled in this environment:

self = <ipatests.test_integration.test_dns.TestDNSMisc object at 0x7f7ad8457b60>
    def test_allow_query_transfer_ipv6(self):
        """Test allow-query and allow-transfer with IPv4 and IPv6.
        Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=701677
        """
        tasks.kinit_admin(self.master)
        zone = "example.com"
        ipv4 = self.master.ip
        ipv6_added = False
        temp_ipv6 = '2001:0db8:0:f101::1/64'
        # Get default network interface
        result = self.master.run_command([
            'sh', '-c',
            "/sbin/ip -4 route show | grep ^default | "
            "awk '{print $5}' | head -1"
        ])
        eth = result.stdout_text.strip()
        # Add temporary IPv6 if none exists
        result = self.master.run_command(
            ['ip', 'addr', 'show', 'scope', 'global'], raiseonerr=False
        )
        if 'inet6' not in result.stdout_text:
>           self.master.run_command([
                '/sbin/ip', '-6', 'addr', 'add', temp_ipv6, 'dev', eth
            ])
eth        = 'enp3s0'
ipv4       = '10.0.201.66'
ipv6_added = False
result     = <pytest_multihost.transport.SSHCommand object at 0x7f7ad841f850>
self       = <ipatests.test_integration.test_dns.TestDNSMisc object at 0x7f7ad8457b60>
temp_ipv6  = '2001:0db8:0:f101::1/64'
zone       = 'example.com'
test_integration/test_dns.py:1712: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
argv = ['/sbin/ip', '-6', 'addr', 'add', '2001:0db8:0:f101::1/64', 'dev', ...]
set_env = True, stdin_text = None, log_stdout = True, raiseonerr = True
cwd = None, bg = False, encoding = 'utf-8', ok_returncode = 0
    def run_command(self, argv, set_env=True, stdin_text=None,
                    log_stdout=True, raiseonerr=True,
                    cwd=None, bg=False, encoding='utf-8', ok_returncode=0):
        """Wrapper around run_command to log stderr on raiseonerr=True
        :param ok_returncode: return code considered to be correct,
                              you can pass an integer or sequence of integers
        """
        result = super().run_command(
            argv, set_env=set_env, stdin_text=stdin_text,
            log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg,
            encoding=encoding
        )
        # in FIPS mode SSH may print noise to stderr, remove the string
        # "FIPS mode initialized" + optional newline.
        result.stderr_bytes = FIPS_NOISE_RE.sub(b'', result.stderr_bytes)
        try:
            result_ok = result.returncode in ok_returncode
        except TypeError:
            result_ok = result.returncode == ok_returncode
        if not result_ok and raiseonerr:
            result.log.error('stderr: %s', result.stderr_text)
>           raise subprocess.CalledProcessError(
                result.returncode, argv,
                result.stdout_text, result.stderr_text
            )
E           subprocess.CalledProcessError: Command '['/sbin/ip', '-6', 'addr', 'add', '2001:0db8:0:f101::1/64', 'dev', 'enp3s0']' returned non-zero exit status 2.
__class__  = <class 'ipatests.pytest_ipa.integration.host.Host'>
argv       = ['/sbin/ip', '-6', 'addr', 'add', '2001:0db8:0:f101::1/64', 'dev', ...]
bg         = False
cwd        = None
encoding   = 'utf-8'
log_stdout = True
ok_returncode = 0
raiseonerr = True
result     = <pytest_multihost.transport.SSHCommand object at 0x7f7ad841f690>
result_ok  = False
self       = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
set_env    = True
stdin_text = None
pytest_ipa/integration/host.py:202: CalledProcessError
----------------------------- Captured stderr call -----------------------------
ipa: ERROR: stderr: Error: ipv6: IPv6 is disabled on this device.

Steps to Reproduce

  1. Run the test test_integration/test_dns.py::TestDNSMisc

Actual behavior

Failure when calling the command /sbin/ip -6 addr add $TEMPIPV6 'dev' enp3s0

Expected behavior

The test should check first if IPv6 is enabled on the interface or skip this part.

Version/Release/Distribution

freeipa-server-4.14.0.dev202602111346+git059aa3f60-0.fc43.x86_64

Additional info:

Logs in https://$ARTIFACTS_SERVER/idm-ci/freeipa_upstream_nightly/Nightly-latest-testing-repo-selinux/master/2026-02-11_17-10/latest-testing-repo-selinux/test_dns/1/report.html?sort=result


Metadata Update from @dhanina:
- Issue assigned to pthube

master:

  • 54d46c4ed285e8c83d5231f65961e1bf67572e8c ipatests: Fix test_allow_query_transfer_ipv6 when IPv6 is disabled

ipa-4-13:

  • 313bd8ff118a79dca5aad0b19ec8f69519258f89 ipatests: Fix test_allow_query_transfer_ipv6 when IPv6 is disabled

ipa-4-12:

  • 7de7c0e2ed1afb2887bc7adeb7363109cbc5f3f9 ipatests: Fix test_allow_query_transfer_ipv6 when IPv6 is disabled

Metadata Update from @sumenon:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata