summaryrefslogtreecommitdiff
path: root/functional
diff options
context:
space:
mode:
authorRichard Theis <rtheis@us.ibm.com>2016-03-08 15:18:16 -0600
committerRichard Theis <rtheis@us.ibm.com>2016-05-27 12:58:25 -0500
commit6a55e05cbf72509898ccc490ca894d766f34d9dc (patch)
tree72924bf2e12354ad2de51db1b33e3cc9a3e09a93 /functional
parent9da02d14eadc39da6f97b3df095af8b0c452a5b4 (diff)
downloadpython-openstackclient-6a55e05cbf72509898ccc490ca894d766f34d9dc.tar.gz
Add network segment command object
Add network segment command object in support of routed networks. This patch set includes documentation, unit tests and functional tests (currently skipped until segments enabled in neutron by default) for the following new commands: - "os network segment list" - "os network segment show" These new commands are currently marked as beta commands. Change-Id: I1a79b48dc6820fe2a39fcceb11c8cae3bda413a0 Partially-Implements: blueprint routed-networks
Diffstat (limited to 'functional')
-rw-r--r--functional/tests/network/v2/test_network_segment.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/functional/tests/network/v2/test_network_segment.py b/functional/tests/network/v2/test_network_segment.py
new file mode 100644
index 00000000..a9980938
--- /dev/null
+++ b/functional/tests/network/v2/test_network_segment.py
@@ -0,0 +1,60 @@
+# 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_show_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_show_opts(['ID', 'Network'])
+ raw_output = cls.openstack('--enable-beta-commands '
+ '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_list_opts(['ID'])
+ raw_output = self.openstack('--enable-beta-commands '
+ 'network segment list' + opts)
+ self.assertIn(self.NETWORK_SEGMENT_ID, raw_output)
+
+ def test_network_segment_show(self):
+ opts = self.get_show_opts(['network_id'])
+ raw_output = self.openstack('--enable-beta-commands '
+ 'network segment show ' +
+ self.NETWORK_SEGMENT_ID + opts)
+ self.assertEqual(self.NETWORK_ID + "\n", raw_output)