From: =?utf-8?q?Lukas_M=C3=A4rdian?= <slyon@ubuntu.com>
Date: Tue, 8 Apr 2025 11:51:19 +0200
Subject: tests:ethernets: Avoid test failure when systemd-resolved is not
 active

When systemd-resolved is not installed or active, we see this test failure
in integration tests:

FAIL: test_manual_addresses (__main__.TestNetworkd.test_manual_addresses)
Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.hth3pnvn/downtmp/build.lIK/real-tree/tests/integration/ethernets.py", line 158, in test_manual_addresses
    self.assertRegex(resolv_conf, 'search.*fakesuffix')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Regex didn't match: 'search.*fakesuffix' not found in '# Generated by NetworkManager\nnameserver 2601::1\nnameserver fe80::449e:58ff:fe88:d68d%eth43\n'

Bug: https://salsa.debian.org/debian/netplan.io/-/merge_requests/17
Forwarded: https://github.com/canonical/netplan/pull/550
Last-Update: 2025-04-08
---
 tests/integration/ethernets.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/integration/ethernets.py b/tests/integration/ethernets.py
index 2196d54..b711cee 100644
--- a/tests/integration/ethernets.py
+++ b/tests/integration/ethernets.py
@@ -155,6 +155,14 @@ class _CommonTests():
         else:
             sys.stdout.write('[/etc/resolv.conf] ')
             sys.stdout.flush()
+            self.skipTest("Netplan needs systemd-resolved or NetworkManager")
+            # FIXME (no systemd-resolved):
+            # AssertionError: Regex didn't match: 'search.*fakesuffix' not found in
+            # '''
+            # # Generated by NetworkManager
+            # nameserver 2601::1
+            # nameserver fe80::449e:58ff:fe88:d68d%eth43
+            # '''
             self.assertRegex(resolv_conf, 'search.*fakesuffix')
             # /etc/resolve.conf often already has three nameserver entries
             if 'nameserver 172.1.2.3' not in resolv_conf:
