diff mbox series

[3/3] auto-t: fix hardcoded 'wlan1' in testNetconfig

Message ID 20220622230219.1557695-3-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/3] test-runner: exclude 'iwd-rtnl' from being enabled with --log | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood June 22, 2022, 11:02 p.m. UTC
This works, if testNetconfig is the only test. Otherwise it will always
fail since the interface naming increments for each test.
---
 autotests/testNetconfig/connection_test.py | 2 +-
 autotests/testNetconfig/static_test.py     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/autotests/testNetconfig/connection_test.py b/autotests/testNetconfig/connection_test.py
index 4b05c745..e73ab335 100644
--- a/autotests/testNetconfig/connection_test.py
+++ b/autotests/testNetconfig/connection_test.py
@@ -80,7 +80,7 @@  class Test(unittest.TestCase):
         rclog = open('/tmp/resolvconf.log', 'r')
         entries = rclog.readlines()
         rclog.close()
-        expected_rclog = ['-a wlan1.dns\n', 'nameserver 192.168.1.2\n', 'nameserver 3ffe:501:ffff:100::2\n']
+        expected_rclog = ['-a %s.dns\n' % ifname, 'nameserver 192.168.1.2\n', 'nameserver 3ffe:501:ffff:100::2\n']
         # Every real resolvconf -a run overwrites the previous settings.  Check the last three lines
         # of our log since we care about the end result here.
         self.assertEqual(expected_rclog, entries[-3:])
diff --git a/autotests/testNetconfig/static_test.py b/autotests/testNetconfig/static_test.py
index ac525b28..d9f0b9cb 100644
--- a/autotests/testNetconfig/static_test.py
+++ b/autotests/testNetconfig/static_test.py
@@ -75,7 +75,7 @@  class Test(unittest.TestCase):
         rclog = open('/tmp/resolvconf.log', 'r')
         entries = rclog.readlines()
         rclog.close()
-        expected_rclog = ['-a wlan1.dns\n', 'nameserver 192.168.1.4\n', 'nameserver 3ffe:501:ffff:200::4\n']
+        expected_rclog = ['-a %s.dns\n' % ifname, 'nameserver 192.168.1.4\n', 'nameserver 3ffe:501:ffff:200::4\n']
         # Every resolvconf -a run overwrites the previous settings.  Check the last three lines
         # of the log since we care about the end result here.
         self.assertEqual(expected_rclog, entries[-3:])