/opt/imh-python/lib/python3.9/site-packages/openstack/tests/functional/network/v2
NameSizeModeActions
__pycache__/-0755rm
test_address_scope.py23420644editdlrm
test_agent.py16410644editdlrm
test_agent_add_remove_network.py21100644editdlrm
test_agent_add_remove_router.py18150644editdlrm
test_auto_allocated_topology.py24410644editdlrm
test_availability_zone.py9890644editdlrm
test_dvr_router.py19460644editdlrm
test_extension.py10650644editdlrm
test_firewall_group.py19090644editdlrm
test_firewall_policy.py19220644editdlrm
test_firewall_rule.py26590644editdlrm
test_firewall_rule_insert_remove_policy.py39360644editdlrm
test_flavor.py29080644editdlrm
test_floating_ip.py74890644editdlrm
test_network.py31740644editdlrm
test_network_ip_availability.py27500644editdlrm
test_network_segment_range.py41330644editdlrm
test_port.py33810644editdlrm
test_port_forwarding.py71680644editdlrm
test_qos_bandwidth_limit_rule.py39800644editdlrm
test_qos_dscp_marking_rule.py30510644editdlrm
test_qos_minimum_bandwidth_rule.py33960644editdlrm
test_qos_policy.py29140644editdlrm
test_qos_rule_type.py13080644editdlrm
test_quota.py15270644editdlrm
test_rbac_policy.py21670644editdlrm
test_router.py23100644editdlrm
test_router_add_remove_interface.py27740644editdlrm
test_security_group.py22510644editdlrm
test_security_group_rule.py26050644editdlrm
test_segment.py38510644editdlrm
test_service_profile.py25270644editdlrm
test_service_provider.py9260644editdlrm
test_subnet.py35200644editdlrm
test_subnet_from_subnet_pool.py30740644editdlrm
test_subnet_pool.py35300644editdlrm
test_trunk.py33400644editdlrm
__init__.py00644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/openstack/tests/functional/network/v2/test_trunk.py (3340B)
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from openstack.network.v2 import network from openstack.network.v2 import port from openstack.network.v2 import trunk as _trunk from openstack.tests.functional import base class TestTrunk(base.BaseFunctionalTest): TIMEOUT_SCALING_FACTOR = 2.0 def setUp(self): super(TestTrunk, self).setUp() self.TRUNK_NAME = self.getUniqueString() self.TRUNK_NAME_UPDATED = self.getUniqueString() net = self.conn.network.create_network() assert isinstance(net, network.Network) self.NET_ID = net.id prt = self.conn.network.create_port(network_id=self.NET_ID) assert isinstance(prt, port.Port) self.PORT_ID = prt.id self.ports_to_clean = [self.PORT_ID] trunk = self.conn.network.create_trunk( name=self.TRUNK_NAME, port_id=self.PORT_ID) assert isinstance(trunk, _trunk.Trunk) self.TRUNK_ID = trunk.id def tearDown(self): self.conn.network.delete_trunk(self.TRUNK_ID, ignore_missing=False) for port_id in self.ports_to_clean: self.conn.network.delete_port(port_id, ignore_missing=False) self.conn.network.delete_network(self.NET_ID, ignore_missing=False) super(TestTrunk, self).tearDown() def test_find(self): sot = self.conn.network.find_trunk(self.TRUNK_NAME) self.assertEqual(self.TRUNK_ID, sot.id) def test_get(self): sot = self.conn.network.get_trunk(self.TRUNK_ID) self.assertEqual(self.TRUNK_ID, sot.id) self.assertEqual(self.TRUNK_NAME, sot.name) def test_list(self): ids = [o.id for o in self.conn.network.trunks()] self.assertIn(self.TRUNK_ID, ids) def test_update(self): sot = self.conn.network.update_trunk(self.TRUNK_ID, name=self.TRUNK_NAME_UPDATED) self.assertEqual(self.TRUNK_NAME_UPDATED, sot.name) def test_subports(self): port_for_subport = self.conn.network.create_port( network_id=self.NET_ID) self.ports_to_clean.append(port_for_subport.id) subports = [{ 'port_id': port_for_subport.id, 'segmentation_type': 'vlan', 'segmentation_id': 111 }] sot = self.conn.network.get_trunk_subports(self.TRUNK_ID) self.assertEqual({'sub_ports': []}, sot) self.conn.network.add_trunk_subports(self.TRUNK_ID, subports) sot = self.conn.network.get_trunk_subports(self.TRUNK_ID) self.assertEqual({'sub_ports': subports}, sot) self.conn.network.delete_trunk_subports( self.TRUNK_ID, [{'port_id': port_for_subport.id}]) sot = self.conn.network.get_trunk_subports(self.TRUNK_ID) self.assertEqual({'sub_ports': []}, sot)