summary refs log tree commit diff
path: root/src/tests/client/test-client.py
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2025-08-01 19:15:13 +0200
committerMichael Biebl <biebl@debian.org>2025-08-01 19:15:13 +0200
commit7e9091a5960f67a84787c03153324915220e4816 (patch)
treedc743de962532932ebc3b4ed3a36ddd093d97d68 /src/tests/client/test-client.py
parent582eb4472a0f3375042afb9026cbeb50e058a27d (diff)
New upstream version 1.54.0 upstream/1.54.0
Diffstat (limited to 'src/tests/client/test-client.py')
-rwxr-xr-xsrc/tests/client/test-client.py107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py
index 62b72b79..cc76d37b 100755
--- a/src/tests/client/test-client.py
+++ b/src/tests/client/test-client.py
@@ -2125,6 +2125,113 @@ class TestNmcli(unittest.TestCase):
             replace_stdout=replace_uuids,
         )
 
+        # It is allowed to set IP method disabled/ignore for ports
+        replace_uuids.append(
+            self.ctx.srv.ReplaceTextConUuid(
+                "con-port1", "UUID-con-port1-REPLACED-REPLACED-REP"
+            )
+        )
+        self.call_nmcli(
+            [
+                "connection",
+                "add",
+                "type",
+                "ethernet",
+                "ifname",
+                "foobar",
+                "con-name",
+                "con-port1",
+                "ipv4.method",
+                "disabled",
+                "ipv6.method",
+                "ignore",
+                "connection.port-type",
+                "bridge",
+                "connection.controller",
+                "bridge1",
+            ],
+            replace_stdout=replace_uuids,
+        )
+
+        # It is NOT allowed to set IP method != disabled/ignore for ports
+        self.call_nmcli(
+            [
+                "connection",
+                "add",
+                "type",
+                "ethernet",
+                "ifname",
+                "foobar",
+                "con-name",
+                "ethernet-foobar",
+                "ipv6.method",
+                "auto",
+                "connection.port-type",
+                "bridge",
+                "connection.controller",
+                "bridge1",
+            ],
+            replace_stdout=replace_uuids,
+        )
+
+        # ovs-interface connections support IP configuration
+        replace_uuids.append(
+            self.ctx.srv.ReplaceTextConUuid(
+                "con-ovs-int", "UUID-con-ovs-int-REPLACED-REPLACED-R"
+            )
+        )
+        self.call_nmcli(
+            [
+                "connection",
+                "add",
+                "type",
+                "ovs-interface",
+                "ifname",
+                "ovs-int",
+                "con-name",
+                "con-ovs-int",
+                "ipv4.method",
+                "auto",
+                "ipv6.method",
+                "link-local",
+                "connection.port-type",
+                "ovs-port",
+                "connection.controller",
+                "ovs-port1",
+            ],
+            replace_stdout=replace_uuids,
+        )
+
+        # VRF ports support IP configuration
+        replace_uuids.append(
+            self.ctx.srv.ReplaceTextConUuid(
+                "con-port2", "UUID-con-port2-REPLACED-REPLACED-REP"
+            )
+        )
+        self.call_nmcli(
+            [
+                "connection",
+                "add",
+                "type",
+                "ethernet",
+                "ifname",
+                "enp1s0",
+                "con-name",
+                "con-port2",
+                "ipv4.method",
+                "manual",
+                "ipv4.addresses",
+                "192.0.2.1/24",
+                "ipv6.method",
+                "dhcp",
+                "connection.port-type",
+                "vrf",
+                "connection.controller",
+                "vrf1",
+            ],
+            replace_stdout=replace_uuids,
+        )
+
     @nm_test_no_dbus
     def test_offline(self):
         # Make sure we're not using D-Bus