diff options
Diffstat (limited to 'functional/tests/network')
| -rw-r--r-- | functional/tests/network/__init__.py | 0 | ||||
| -rw-r--r-- | functional/tests/network/v2/__init__.py | 0 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_address_scope.py | 49 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_floating_ip.py | 58 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_ip_availability.py | 53 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_network.py | 50 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_network_agent.py | 41 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_network_rbac.py | 69 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_network_segment.py | 60 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_port.py | 58 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_router.py | 50 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_security_group.py | 60 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_security_group_rule.py | 67 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_subnet.py | 66 | ||||
| -rw-r--r-- | functional/tests/network/v2/test_subnet_pool.py | 55 |
15 files changed, 0 insertions, 736 deletions
diff --git a/functional/tests/network/__init__.py b/functional/tests/network/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functional/tests/network/__init__.py +++ /dev/null diff --git a/functional/tests/network/v2/__init__.py b/functional/tests/network/v2/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functional/tests/network/v2/__init__.py +++ /dev/null diff --git a/functional/tests/network/v2/test_address_scope.py b/functional/tests/network/v2/test_address_scope.py deleted file mode 100644 index 3beab233..00000000 --- a/functional/tests/network/v2/test_address_scope.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class AddressScopeTests(test.TestCase): - """Functional tests for address scope. """ - NAME = uuid.uuid4().hex - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack('address scope create ' + cls.NAME + opts) - cls.assertOutput(cls.NAME + "\n", raw_output) - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('address scope delete ' + cls.NAME) - cls.assertOutput('', raw_output) - - def test_address_scope_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('address scope list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_address_scope_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('address scope show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n", raw_output) - - def test_address_scope_set(self): - self.openstack('address scope set --share ' + self.NAME) - opts = self.get_opts(['shared']) - raw_output = self.openstack('address scope show ' + self.NAME + opts) - self.assertEqual("True\n", raw_output) diff --git a/functional/tests/network/v2/test_floating_ip.py b/functional/tests/network/v2/test_floating_ip.py deleted file mode 100644 index 7e7c63f4..00000000 --- a/functional/tests/network/v2/test_floating_ip.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class FloatingIpTests(test.TestCase): - """Functional tests for floating ip. """ - SUBNET_NAME = uuid.uuid4().hex - NETWORK_NAME = uuid.uuid4().hex - ID = None - HEADERS = ['ID'] - FIELDS = ['id'] - - @classmethod - def setUpClass(cls): - # Create a network for the floating ip. - cls.openstack('network create --external ' + cls.NETWORK_NAME) - # Create a subnet for the network. - cls.openstack( - 'subnet create --network ' + cls.NETWORK_NAME + - ' --subnet-range 10.10.10.0/24 ' + - cls.SUBNET_NAME - ) - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack( - 'floating ip create ' + cls.NETWORK_NAME + opts) - cls.ID = raw_output.strip('\n') - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('floating ip delete ' + cls.ID) - cls.assertOutput('', raw_output) - raw_output = cls.openstack('subnet delete ' + cls.SUBNET_NAME) - cls.assertOutput('', raw_output) - raw_output = cls.openstack('network delete ' + cls.NETWORK_NAME) - cls.assertOutput('', raw_output) - - def test_floating_ip_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('floating ip list' + opts) - self.assertIn(self.ID, raw_output) - - def test_floating_ip_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('floating ip show ' + self.ID + opts) - self.assertEqual(self.ID + "\n", raw_output) diff --git a/functional/tests/network/v2/test_ip_availability.py b/functional/tests/network/v2/test_ip_availability.py deleted file mode 100644 index e83010fd..00000000 --- a/functional/tests/network/v2/test_ip_availability.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class IPAvailabilityTests(test.TestCase): - """Functional tests for IP availability. """ - NAME = uuid.uuid4().hex - NETWORK_NAME = uuid.uuid4().hex - FIELDS = ['network_name'] - - @classmethod - def setUpClass(cls): - # Create a network for the subnet. - cls.openstack('network create ' + cls.NETWORK_NAME) - opts = cls.get_opts(['name']) - raw_output = cls.openstack( - 'subnet create --network ' + cls.NETWORK_NAME + - ' --subnet-range 10.10.10.0/24 ' + - cls.NAME + opts - ) - expected = cls.NAME + '\n' - cls.assertOutput(expected, raw_output) - - @classmethod - def tearDownClass(cls): - raw_subnet = cls.openstack('subnet delete ' + cls.NAME) - raw_network = cls.openstack('network delete ' + cls.NETWORK_NAME) - cls.assertOutput('', raw_subnet) - cls.assertOutput('', raw_network) - - def test_ip_availability_list(self): - opts = ' -f csv -c "Network Name"' - raw_output = self.openstack('ip availability list' + opts) - self.assertIn(self.NETWORK_NAME, raw_output) - - def test_ip_availability_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack( - 'ip availability show ' + self.NETWORK_NAME + opts) - self.assertEqual(self.NETWORK_NAME + "\n", raw_output) diff --git a/functional/tests/network/v2/test_network.py b/functional/tests/network/v2/test_network.py deleted file mode 100644 index f5c92faa..00000000 --- a/functional/tests/network/v2/test_network.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class NetworkTests(test.TestCase): - """Functional tests for network. """ - NAME = uuid.uuid4().hex - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack('network create ' + cls.NAME + opts) - expected = cls.NAME + '\n' - cls.assertOutput(expected, raw_output) - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('network delete ' + cls.NAME) - cls.assertOutput('', raw_output) - - def test_network_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('network list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_network_set(self): - raw_output = self.openstack('network set --disable ' + self.NAME) - opts = self.get_opts(['name', 'admin_state_up']) - raw_output = self.openstack('network show ' + self.NAME + opts) - self.assertEqual("DOWN\n" + self.NAME + "\n", raw_output) - - def test_network_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('network show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n", raw_output) diff --git a/functional/tests/network/v2/test_network_agent.py b/functional/tests/network/v2/test_network_agent.py deleted file mode 100644 index f574c50c..00000000 --- a/functional/tests/network/v2/test_network_agent.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 functional.common import test - - -class NetworkAgentTests(test.TestCase): - """Functional tests for network agent. """ - IDs = None - HEADERS = ['ID'] - FIELDS = ['id'] - - @classmethod - def test_network_agent_list(cls): - opts = cls.get_opts(cls.HEADERS) - raw_output = cls.openstack('network agent list' + opts) - # get the list of network agent IDs. - cls.IDs = raw_output.split('\n') - - def test_network_agent_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('network agent show ' + self.IDs[0] + opts) - self.assertEqual(self.IDs[0] + "\n", raw_output) - - def test_network_agent_set(self): - opts = self.get_opts(['admin_state_up']) - self.openstack('network agent set --disable ' + self.IDs[0]) - raw_output = self.openstack('network agent show ' + self.IDs[0] + opts) - self.assertEqual("DOWN\n", raw_output) - self.openstack('network agent set --enable ' + self.IDs[0]) - raw_output = self.openstack('network agent show ' + self.IDs[0] + opts) - self.assertEqual("UP\n", raw_output) diff --git a/functional/tests/network/v2/test_network_rbac.py b/functional/tests/network/v2/test_network_rbac.py deleted file mode 100644 index 1dbc246b..00000000 --- a/functional/tests/network/v2/test_network_rbac.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class NetworkRBACTests(test.TestCase): - """Functional tests for network rbac. """ - NET_NAME = uuid.uuid4().hex - PROJECT_NAME = uuid.uuid4().hex - OBJECT_ID = None - ID = None - HEADERS = ['ID'] - FIELDS = ['id'] - - @classmethod - def setUpClass(cls): - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack('network create ' + cls.NET_NAME + opts) - cls.OBJECT_ID = raw_output.strip('\n') - opts = cls.get_opts(['id', 'object_id']) - raw_output = cls.openstack('network rbac create ' + - cls.OBJECT_ID + - ' --action access_as_shared' + - ' --target-project admin' + - ' --type network' + opts) - cls.ID, object_id, rol = tuple(raw_output.split('\n')) - cls.assertOutput(cls.OBJECT_ID, object_id) - - @classmethod - def tearDownClass(cls): - raw_output_rbac = cls.openstack('network rbac delete ' + cls.ID) - raw_output_network = cls.openstack('network delete ' + cls.OBJECT_ID) - cls.assertOutput('', raw_output_rbac) - cls.assertOutput('', raw_output_network) - - def test_network_rbac_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('network rbac list' + opts) - self.assertIn(self.ID, raw_output) - - def test_network_rbac_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('network rbac show ' + self.ID + opts) - self.assertEqual(self.ID + "\n", raw_output) - - def test_network_rbac_set(self): - opts = self.get_opts(self.FIELDS) - project_id = self.openstack( - 'project create ' + self.PROJECT_NAME + opts) - self.openstack('network rbac set ' + self.ID + - ' --target-project ' + self.PROJECT_NAME) - opts = self.get_opts(['target_project_id']) - raw_output_rbac = self.openstack('network rbac show ' + self.ID + opts) - raw_output_project = self.openstack( - 'project delete ' + self.PROJECT_NAME) - self.assertEqual(project_id, raw_output_rbac) - self.assertOutput('', raw_output_project) diff --git a/functional/tests/network/v2/test_network_segment.py b/functional/tests/network/v2/test_network_segment.py deleted file mode 100644 index 4609973c..00000000 --- a/functional/tests/network/v2/test_network_segment.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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. - -import testtools -import uuid - -from functional.common import test - - -# NOTE(rtheis): Routed networks is still a WIP and not enabled by default. -@testtools.skip("bp/routed-networks") -class NetworkSegmentTests(test.TestCase): - """Functional tests for network segment. """ - NETWORK_NAME = uuid.uuid4().hex - PHYSICAL_NETWORK_NAME = uuid.uuid4().hex - NETWORK_SEGMENT_ID = None - NETWORK_ID = None - - @classmethod - def setUpClass(cls): - # Create a network for the segment. - opts = cls.get_opts(['id']) - raw_output = cls.openstack('network create ' + cls.NETWORK_NAME + opts) - cls.NETWORK_ID = raw_output.strip('\n') - - # Get the segment for the network. - opts = cls.get_opts(['ID', 'Network']) - raw_output = cls.openstack('--os-beta-command ' - 'network segment list ' - ' --network ' + cls.NETWORK_NAME + - ' ' + opts) - raw_output_row = raw_output.split('\n')[0] - cls.NETWORK_SEGMENT_ID = raw_output_row.split(' ')[0] - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('network delete ' + cls.NETWORK_NAME) - cls.assertOutput('', raw_output) - - def test_network_segment_list(self): - opts = self.get_opts(['ID']) - raw_output = self.openstack('--os-beta-command ' - 'network segment list' + opts) - self.assertIn(self.NETWORK_SEGMENT_ID, raw_output) - - def test_network_segment_show(self): - opts = self.get_opts(['network_id']) - raw_output = self.openstack('--os-beta-command ' - 'network segment show ' + - self.NETWORK_SEGMENT_ID + opts) - self.assertEqual(self.NETWORK_ID + "\n", raw_output) diff --git a/functional/tests/network/v2/test_port.py b/functional/tests/network/v2/test_port.py deleted file mode 100644 index a68019c4..00000000 --- a/functional/tests/network/v2/test_port.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class PortTests(test.TestCase): - """Functional tests for port. """ - NAME = uuid.uuid4().hex - NETWORK_NAME = uuid.uuid4().hex - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - # Create a network for the subnet. - cls.openstack('network create ' + cls.NETWORK_NAME) - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack( - 'port create --network ' + cls.NETWORK_NAME + ' ' + - cls.NAME + opts - ) - expected = cls.NAME + '\n' - cls.assertOutput(expected, raw_output) - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('port delete ' + cls.NAME) - cls.assertOutput('', raw_output) - raw_output = cls.openstack('network delete ' + cls.NETWORK_NAME) - cls.assertOutput('', raw_output) - - def test_port_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('port list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_port_set(self): - self.openstack('port set --disable ' + self.NAME) - opts = self.get_opts(['name', 'admin_state_up']) - raw_output = self.openstack('port show ' + self.NAME + opts) - self.assertEqual("DOWN\n" + self.NAME + "\n", raw_output) - - def test_port_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('port show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n", raw_output) diff --git a/functional/tests/network/v2/test_router.py b/functional/tests/network/v2/test_router.py deleted file mode 100644 index e536c64e..00000000 --- a/functional/tests/network/v2/test_router.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class RouterTests(test.TestCase): - """Functional tests for router. """ - NAME = uuid.uuid4().hex - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack('router create ' + cls.NAME + opts) - expected = cls.NAME + '\n' - cls.assertOutput(expected, raw_output) - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('router delete ' + cls.NAME) - cls.assertOutput('', raw_output) - - def test_router_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('router list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_router_set(self): - self.openstack('router set --disable ' + self.NAME) - opts = self.get_opts(['name', 'admin_state_up']) - raw_output = self.openstack('router show ' + self.NAME + opts) - self.assertEqual("DOWN\n" + self.NAME + "\n", raw_output) - - def test_router_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('router show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n", raw_output) diff --git a/functional/tests/network/v2/test_security_group.py b/functional/tests/network/v2/test_security_group.py deleted file mode 100644 index 2a3b92a0..00000000 --- a/functional/tests/network/v2/test_security_group.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class SecurityGroupTests(test.TestCase): - """Functional tests for security group. """ - NAME = uuid.uuid4().hex - OTHER_NAME = uuid.uuid4().hex - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack('security group create ' + cls.NAME + opts) - expected = cls.NAME + '\n' - cls.assertOutput(expected, raw_output) - - @classmethod - def tearDownClass(cls): - # Rename test - raw_output = cls.openstack('security group set --name ' + - cls.OTHER_NAME + ' ' + cls.NAME) - cls.assertOutput('', raw_output) - # Delete test - raw_output = cls.openstack('security group delete ' + cls.OTHER_NAME) - cls.assertOutput('', raw_output) - - def test_security_group_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('security group list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_security_group_set(self): - raw_output = self.openstack( - 'security group set --description NSA ' + self.NAME - ) - self.assertEqual('', raw_output) - - opts = self.get_opts(['description']) - raw_output = self.openstack('security group show ' + self.NAME + opts) - self.assertEqual("NSA\n", raw_output) - - def test_security_group_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('security group show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n", raw_output) diff --git a/functional/tests/network/v2/test_security_group_rule.py b/functional/tests/network/v2/test_security_group_rule.py deleted file mode 100644 index 248d20b1..00000000 --- a/functional/tests/network/v2/test_security_group_rule.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class SecurityGroupRuleTests(test.TestCase): - """Functional tests for security group rule. """ - SECURITY_GROUP_NAME = uuid.uuid4().hex - SECURITY_GROUP_RULE_ID = None - NAME_FIELD = ['name'] - ID_FIELD = ['id'] - ID_HEADER = ['ID'] - - @classmethod - def setUpClass(cls): - # Create the security group to hold the rule. - opts = cls.get_opts(cls.NAME_FIELD) - raw_output = cls.openstack('security group create ' + - cls.SECURITY_GROUP_NAME + - opts) - expected = cls.SECURITY_GROUP_NAME + '\n' - cls.assertOutput(expected, raw_output) - - # Create the security group rule. - opts = cls.get_opts(cls.ID_FIELD) - raw_output = cls.openstack('security group rule create ' + - cls.SECURITY_GROUP_NAME + - ' --protocol tcp --dst-port 80:80' + - ' --ingress --ethertype IPv4' + - opts) - cls.SECURITY_GROUP_RULE_ID = raw_output.strip('\n') - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('security group rule delete ' + - cls.SECURITY_GROUP_RULE_ID) - cls.assertOutput('', raw_output) - - raw_output = cls.openstack('security group delete ' + - cls.SECURITY_GROUP_NAME) - cls.assertOutput('', raw_output) - - def test_security_group_rule_list(self): - opts = self.get_opts(self.ID_HEADER) - raw_output = self.openstack('security group rule list ' + - self.SECURITY_GROUP_NAME + - opts) - self.assertIn(self.SECURITY_GROUP_RULE_ID, raw_output) - - def test_security_group_rule_show(self): - opts = self.get_opts(self.ID_FIELD) - raw_output = self.openstack('security group rule show ' + - self.SECURITY_GROUP_RULE_ID + - opts) - self.assertEqual(self.SECURITY_GROUP_RULE_ID + "\n", raw_output) diff --git a/functional/tests/network/v2/test_subnet.py b/functional/tests/network/v2/test_subnet.py deleted file mode 100644 index 7fb48437..00000000 --- a/functional/tests/network/v2/test_subnet.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class SubnetTests(test.TestCase): - """Functional tests for subnet. """ - NAME = uuid.uuid4().hex - NETWORK_NAME = uuid.uuid4().hex - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - # Create a network for the subnet. - cls.openstack('network create ' + cls.NETWORK_NAME) - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack( - 'subnet create --network ' + cls.NETWORK_NAME + - ' --subnet-range 10.10.10.0/24 ' + - cls.NAME + opts - ) - expected = cls.NAME + '\n' - cls.assertOutput(expected, raw_output) - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('subnet delete ' + cls.NAME) - cls.assertOutput('', raw_output) - raw_output = cls.openstack('network delete ' + cls.NETWORK_NAME) - cls.assertOutput('', raw_output) - - def test_subnet_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('subnet list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_subnet_set(self): - self.openstack('subnet set --no-dhcp ' + self.NAME) - opts = self.get_opts(['name', 'enable_dhcp']) - raw_output = self.openstack('subnet show ' + self.NAME + opts) - self.assertEqual("False\n" + self.NAME + "\n", raw_output) - - def test_subnet_set_service_type(self): - TYPE = 'network:floatingip_agent_gateway' - self.openstack('subnet set --service-type ' + TYPE + ' ' + self.NAME) - opts = self.get_opts(['name', 'service_types']) - raw_output = self.openstack('subnet show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n" + TYPE + "\n", raw_output) - - def test_subnet_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('subnet show ' + self.NAME + opts) - self.assertEqual(self.NAME + "\n", raw_output) diff --git a/functional/tests/network/v2/test_subnet_pool.py b/functional/tests/network/v2/test_subnet_pool.py deleted file mode 100644 index 054188f7..00000000 --- a/functional/tests/network/v2/test_subnet_pool.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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. - -import uuid - -from functional.common import test - - -class SubnetPoolTests(test.TestCase): - """Functional tests for subnet pool. """ - NAME = uuid.uuid4().hex - CREATE_POOL_PREFIX = '10.100.0.0/24' - SET_POOL_PREFIX = '10.100.0.0/16' - HEADERS = ['Name'] - FIELDS = ['name'] - - @classmethod - def setUpClass(cls): - opts = cls.get_opts(cls.FIELDS) - raw_output = cls.openstack('subnet pool create --pool-prefix ' + - cls.CREATE_POOL_PREFIX + ' ' + - cls.NAME + opts) - cls.assertOutput(cls.NAME + '\n', raw_output) - - @classmethod - def tearDownClass(cls): - raw_output = cls.openstack('subnet pool delete ' + cls.NAME) - cls.assertOutput('', raw_output) - - def test_subnet_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('subnet pool list' + opts) - self.assertIn(self.NAME, raw_output) - - def test_subnet_set(self): - self.openstack('subnet pool set --pool-prefix ' + - self.SET_POOL_PREFIX + ' ' + self.NAME) - opts = self.get_opts(['prefixes', 'name']) - raw_output = self.openstack('subnet pool show ' + self.NAME + opts) - self.assertEqual(self.NAME + '\n' + self.SET_POOL_PREFIX + '\n', - raw_output) - - def test_subnet_show(self): - opts = self.get_opts(self.FIELDS) - raw_output = self.openstack('subnet pool show ' + self.NAME + opts) - self.assertEqual(self.NAME + '\n', raw_output) |
