Skip to content

Commit f9fe9da

Browse files
security group: fix component test test_multiple_nic_support.py failures (#5348)
This PR fixes component test failure with test_multiple_nic_support.py, in advanced zone with security groups. Co-authored-by: dahn <daan.hoogland@gmail.com>
1 parent c1fc002 commit f9fe9da

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/vm/network/security_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ def verify_iptables_rules_for_bridge(brname):
14531453
expected_rules.append("-A %s -m state --state RELATED,ESTABLISHED -j ACCEPT" % (brfw))
14541454
expected_rules.append("-A %s -m physdev --physdev-is-in --physdev-is-bridged -j %s" % (brfw, brfwin))
14551455
expected_rules.append("-A %s -m physdev --physdev-is-out --physdev-is-bridged -j %s" % (brfw, brfwout))
1456-
phydev = execute("ip link show type bridge | awk '/^%s[ \t]/ {print $4}'" % brname ).strip()
1456+
phydev = get_bridge_physdev(brname)
14571457
expected_rules.append("-A %s -m physdev --physdev-out %s --physdev-is-bridged -j ACCEPT" % (brfw, phydev))
14581458

14591459
rules = execute("iptables-save |grep -w %s |grep -v \"^:\"" % brfw).split('\n')

test/integration/component/test_multiple_nic_support.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def setUpClass(cls):
224224
cls.virtual_machine1.default_network_id = nic.networkid
225225
break
226226
except Exception as e:
227-
cls.fail("Exception while deploying virtual machine: %s" % e)
227+
cls.fail(f"Exception while deploying virtual machine: {e}")
228228

229229
try:
230230
cls.virtual_machine2 = VirtualMachine.create(
@@ -243,7 +243,7 @@ def setUpClass(cls):
243243
cls.virtual_machine2.default_network_id = nic.networkid
244244
break
245245
except Exception as e:
246-
cls.fail("Exception while deploying virtual machine: %s" % e)
246+
cls.fail(f"Exception while deploying virtual machine: {e}")
247247

248248
cls._cleanup.append(cls.virtual_machine1)
249249
cls._cleanup.append(cls.virtual_machine2)
@@ -306,7 +306,7 @@ def verify_network_rules(self, vm_id):
306306
if len(result) > 0:
307307
self.fail("The iptables/ebtables rules for nic %s on vm %s on host %s are not correct" %(nic.ipaddress, vm.instancename, host.name))
308308

309-
@attr(tags=["adeancedsg"], required_hardware="false")
309+
@attr(tags=["advancedsg"], required_hardware="false")
310310
def test_01_create_vm_with_multiple_nics(self):
311311
"""Create Vm with multiple NIC's
312312

0 commit comments

Comments
 (0)