You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2021/08/20 11:36:41 UTC
[cloudstack] branch 4.15 updated: security group: fix component
test test_multiple_nic_support.py failures (#5348)
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch 4.15
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.15 by this push:
new f9fe9da security group: fix component test test_multiple_nic_support.py failures (#5348)
f9fe9da is described below
commit f9fe9da734318f3e9d7f2f06b5b10666fdd8ecd4
Author: Wei Zhou <57...@users.noreply.github.com>
AuthorDate: Fri Aug 20 13:36:26 2021 +0200
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 <da...@gmail.com>
---
scripts/vm/network/security_group.py | 2 +-
test/integration/component/test_multiple_nic_support.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py
index a42ac34..6be06ed 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -1453,7 +1453,7 @@ def verify_iptables_rules_for_bridge(brname):
expected_rules.append("-A %s -m state --state RELATED,ESTABLISHED -j ACCEPT" % (brfw))
expected_rules.append("-A %s -m physdev --physdev-is-in --physdev-is-bridged -j %s" % (brfw, brfwin))
expected_rules.append("-A %s -m physdev --physdev-is-out --physdev-is-bridged -j %s" % (brfw, brfwout))
- phydev = execute("ip link show type bridge | awk '/^%s[ \t]/ {print $4}'" % brname ).strip()
+ phydev = get_bridge_physdev(brname)
expected_rules.append("-A %s -m physdev --physdev-out %s --physdev-is-bridged -j ACCEPT" % (brfw, phydev))
rules = execute("iptables-save |grep -w %s |grep -v \"^:\"" % brfw).split('\n')
diff --git a/test/integration/component/test_multiple_nic_support.py b/test/integration/component/test_multiple_nic_support.py
index d38693c..5b1bb71 100644
--- a/test/integration/component/test_multiple_nic_support.py
+++ b/test/integration/component/test_multiple_nic_support.py
@@ -224,7 +224,7 @@ class TestMulipleNicSupport(cloudstackTestCase):
cls.virtual_machine1.default_network_id = nic.networkid
break
except Exception as e:
- cls.fail("Exception while deploying virtual machine: %s" % e)
+ cls.fail(f"Exception while deploying virtual machine: {e}")
try:
cls.virtual_machine2 = VirtualMachine.create(
@@ -243,7 +243,7 @@ class TestMulipleNicSupport(cloudstackTestCase):
cls.virtual_machine2.default_network_id = nic.networkid
break
except Exception as e:
- cls.fail("Exception while deploying virtual machine: %s" % e)
+ cls.fail(f"Exception while deploying virtual machine: {e}")
cls._cleanup.append(cls.virtual_machine1)
cls._cleanup.append(cls.virtual_machine2)
@@ -306,7 +306,7 @@ class TestMulipleNicSupport(cloudstackTestCase):
if len(result) > 0:
self.fail("The iptables/ebtables rules for nic %s on vm %s on host %s are not correct" %(nic.ipaddress, vm.instancename, host.name))
- @attr(tags=["adeancedsg"], required_hardware="false")
+ @attr(tags=["advancedsg"], required_hardware="false")
def test_01_create_vm_with_multiple_nics(self):
"""Create Vm with multiple NIC's