def test_port_group_exists(self): """Test new port group is not added or modified. If Port Group was not existent, acls would be added. """ self.api.pg_add( self.PG_NAME, acls=[], may_exist=True).execute(check_error=True) mech_driver.create_default_drop_port_group(self.api) port_group = self.api.get_port_group(self.PG_NAME) self.assertFalse(port_group.acls)
def _test_pg_with_ports(self, expected_ports=None): expected_ports = expected_ports or [] mech_driver.create_default_drop_port_group(self.api) port_group = self.api.get_port_group(self.PG_NAME) self.assertItemsEqual( expected_ports, [port.name for port in port_group.ports])