Nova net functional tests round 2
* floating ip * ip availability * network qos policy * network qos rule * network qos rule type * network rbac Change-Id: Id3946bdff43bfef3a1d879c058bde4792bd299c6
This commit is contained in:
parent
e0d1af94a1
commit
dd7da49325
@ -14,10 +14,10 @@ import random
|
|||||||
import re
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class FloatingIpTests(base.TestCase):
|
class FloatingIpTests(common.NetworkTests):
|
||||||
"""Functional tests for floating ip"""
|
"""Functional tests for floating ip"""
|
||||||
SUBNET_NAME = uuid.uuid4().hex
|
SUBNET_NAME = uuid.uuid4().hex
|
||||||
NETWORK_NAME = uuid.uuid4().hex
|
NETWORK_NAME = uuid.uuid4().hex
|
||||||
@ -28,78 +28,97 @@ class FloatingIpTests(base.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
# Set up some regex for matching below
|
common.NetworkTests.setUpClass()
|
||||||
cls.re_id = re.compile("id\s+\|\s+(\S+)")
|
if cls.haz_network:
|
||||||
cls.re_floating_ip = re.compile("floating_ip_address\s+\|\s+(\S+)")
|
# Set up some regex for matching below
|
||||||
cls.re_fixed_ip = re.compile("fixed_ip_address\s+\|\s+(\S+)")
|
cls.re_id = re.compile("id\s+\|\s+(\S+)")
|
||||||
cls.re_description = re.compile("description\s+\|\s+([^|]+?)\s+\|")
|
cls.re_floating_ip = re.compile("floating_ip_address\s+\|\s+(\S+)")
|
||||||
cls.re_network_id = re.compile("floating_network_id\s+\|\s+(\S+)")
|
cls.re_fixed_ip = re.compile("fixed_ip_address\s+\|\s+(\S+)")
|
||||||
cls.re_port_id = re.compile("\s+id\s+\|\s+(\S+)")
|
cls.re_description = re.compile("description\s+\|\s+([^|]+?)\s+\|")
|
||||||
cls.re_fp_port_id = re.compile("\s+port_id\s+\|\s+(\S+)")
|
cls.re_network_id = re.compile("floating_network_id\s+\|\s+(\S+)")
|
||||||
|
cls.re_port_id = re.compile("\s+id\s+\|\s+(\S+)")
|
||||||
|
cls.re_fp_port_id = re.compile("\s+port_id\s+\|\s+(\S+)")
|
||||||
|
|
||||||
# Create a network for the floating ip
|
# Create a network for the floating ip
|
||||||
raw_output = cls.openstack(
|
raw_output = cls.openstack(
|
||||||
'network create --external ' + cls.NETWORK_NAME
|
'network create --external ' + cls.NETWORK_NAME
|
||||||
)
|
)
|
||||||
cls.network_id = re.search(cls.re_id, raw_output).group(1)
|
cls.network_id = re.search(cls.re_id, raw_output).group(1)
|
||||||
|
|
||||||
# Create a private network for the port
|
# Create a private network for the port
|
||||||
raw_output = cls.openstack(
|
raw_output = cls.openstack(
|
||||||
'network create ' + cls.PRIVATE_NETWORK_NAME
|
'network create ' + cls.PRIVATE_NETWORK_NAME
|
||||||
)
|
)
|
||||||
cls.private_network_id = re.search(cls.re_id, raw_output).group(1)
|
cls.private_network_id = re.search(cls.re_id, raw_output).group(1)
|
||||||
|
|
||||||
# Try random subnet range for subnet creating
|
# Try random subnet range for subnet creating
|
||||||
# Because we can not determine ahead of time what subnets are already
|
# Because we can not determine ahead of time what subnets are
|
||||||
# in use, possibly by another test running in parallel, try 4 times
|
# already in use, possibly by another test running in parallel,
|
||||||
for i in range(4):
|
# try 4 times
|
||||||
# Make a random subnet
|
for i in range(4):
|
||||||
cls.subnet = ".".join(map(
|
# Make a random subnet
|
||||||
str,
|
cls.subnet = ".".join(map(
|
||||||
(random.randint(0, 223) for _ in range(3))
|
str,
|
||||||
)) + ".0/26"
|
(random.randint(0, 223) for _ in range(3))
|
||||||
cls.private_subnet = ".".join(map(
|
)) + ".0/26"
|
||||||
str,
|
cls.private_subnet = ".".join(map(
|
||||||
(random.randint(0, 223) for _ in range(3))
|
str,
|
||||||
)) + ".0/26"
|
(random.randint(0, 223) for _ in range(3))
|
||||||
try:
|
)) + ".0/26"
|
||||||
# Create a subnet for the network
|
try:
|
||||||
raw_output = cls.openstack(
|
# Create a subnet for the network
|
||||||
'subnet create ' +
|
raw_output = cls.openstack(
|
||||||
'--network ' + cls.NETWORK_NAME + ' ' +
|
'subnet create ' +
|
||||||
'--subnet-range ' + cls.subnet + ' ' +
|
'--network ' + cls.NETWORK_NAME + ' ' +
|
||||||
cls.SUBNET_NAME
|
'--subnet-range ' + cls.subnet + ' ' +
|
||||||
)
|
cls.SUBNET_NAME
|
||||||
# Create a subnet for the private network
|
)
|
||||||
priv_raw_output = cls.openstack(
|
# Create a subnet for the private network
|
||||||
'subnet create ' +
|
priv_raw_output = cls.openstack(
|
||||||
'--network ' + cls.PRIVATE_NETWORK_NAME + ' ' +
|
'subnet create ' +
|
||||||
'--subnet-range ' + cls.private_subnet + ' ' +
|
'--network ' + cls.PRIVATE_NETWORK_NAME + ' ' +
|
||||||
cls.PRIVATE_SUBNET_NAME
|
'--subnet-range ' + cls.private_subnet + ' ' +
|
||||||
)
|
cls.PRIVATE_SUBNET_NAME
|
||||||
except Exception:
|
)
|
||||||
if (i == 3):
|
except Exception:
|
||||||
# raise the exception at the last time
|
if (i == 3):
|
||||||
raise
|
# raise the exception at the last time
|
||||||
pass
|
raise
|
||||||
else:
|
pass
|
||||||
# break and no longer retry if create sucessfully
|
else:
|
||||||
break
|
# break and no longer retry if create sucessfully
|
||||||
|
break
|
||||||
|
|
||||||
cls.subnet_id = re.search(cls.re_id, raw_output).group(1)
|
cls.subnet_id = re.search(cls.re_id, raw_output).group(1)
|
||||||
cls.private_subnet_id = re.search(cls.re_id, priv_raw_output).group(1)
|
cls.private_subnet_id = re.search(
|
||||||
|
cls.re_id, priv_raw_output
|
||||||
|
).group(1)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
raw_output = cls.openstack('subnet delete ' + cls.SUBNET_NAME)
|
if cls.haz_network:
|
||||||
cls.assertOutput('', raw_output)
|
raw_output = cls.openstack(
|
||||||
raw_output = cls.openstack('subnet delete ' + cls.PRIVATE_SUBNET_NAME)
|
'subnet delete ' + cls.SUBNET_NAME,
|
||||||
cls.assertOutput('', raw_output)
|
)
|
||||||
raw_output = cls.openstack('network delete ' + cls.NETWORK_NAME)
|
cls.assertOutput('', raw_output)
|
||||||
cls.assertOutput('', raw_output)
|
raw_output = cls.openstack(
|
||||||
raw_output = cls.openstack(
|
'subnet delete ' + cls.PRIVATE_SUBNET_NAME,
|
||||||
'network delete ' + cls.PRIVATE_NETWORK_NAME)
|
)
|
||||||
cls.assertOutput('', raw_output)
|
cls.assertOutput('', raw_output)
|
||||||
|
raw_output = cls.openstack(
|
||||||
|
'network delete ' + cls.NETWORK_NAME,
|
||||||
|
)
|
||||||
|
cls.assertOutput('', raw_output)
|
||||||
|
raw_output = cls.openstack(
|
||||||
|
'network delete ' + cls.PRIVATE_NETWORK_NAME,
|
||||||
|
)
|
||||||
|
cls.assertOutput('', raw_output)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(FloatingIpTests, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
def test_floating_ip_delete(self):
|
def test_floating_ip_delete(self):
|
||||||
"""Test create, delete multiple"""
|
"""Test create, delete multiple"""
|
||||||
|
@ -13,14 +13,18 @@
|
|||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class IPAvailabilityTests(base.TestCase):
|
class IPAvailabilityTests(common.NetworkTests):
|
||||||
"""Functional tests for IP availability. """
|
"""Functional tests for IP availability. """
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
common.NetworkTests.setUpClass()
|
||||||
|
if not cls.haz_network:
|
||||||
|
common.NetworkTests.skipTest(cls, "No Network service present")
|
||||||
|
|
||||||
# Create a network for the subnet.
|
# Create a network for the subnet.
|
||||||
cls.NAME = uuid.uuid4().hex
|
cls.NAME = uuid.uuid4().hex
|
||||||
cls.NETWORK_NAME = uuid.uuid4().hex
|
cls.NETWORK_NAME = uuid.uuid4().hex
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class QosPolicyTests(base.TestCase):
|
class NetworkQosPolicyTests(common.NetworkTests):
|
||||||
"""Functional tests for QoS policy. """
|
"""Functional tests for QoS policy. """
|
||||||
NAME = uuid.uuid4().hex
|
NAME = uuid.uuid4().hex
|
||||||
HEADERS = ['Name']
|
HEADERS = ['Name']
|
||||||
@ -26,11 +26,18 @@ class QosPolicyTests(base.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
common.NetworkTests.setUpClass()
|
||||||
opts = cls.get_opts(cls.FIELDS)
|
opts = cls.get_opts(cls.FIELDS)
|
||||||
raw_output = cls.openstack('network qos policy create ' + cls.NAME +
|
raw_output = cls.openstack('network qos policy create ' + cls.NAME +
|
||||||
opts)
|
opts)
|
||||||
cls.assertOutput(cls.NAME + "\n", raw_output)
|
cls.assertOutput(cls.NAME + "\n", raw_output)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(NetworkQosPolicyTests, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
raw_output = cls.openstack('network qos policy delete ' + cls.NAME)
|
raw_output = cls.openstack('network qos policy delete ' + cls.NAME)
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class NetworkQosRuleTestsMinimumBandwidth(base.TestCase):
|
class NetworkQosRuleTestsMinimumBandwidth(common.NetworkTests):
|
||||||
"""Functional tests for QoS minimum bandwidth rule."""
|
"""Functional tests for QoS minimum bandwidth rule."""
|
||||||
RULE_ID = None
|
RULE_ID = None
|
||||||
QOS_POLICY_NAME = 'qos_policy_' + uuid.uuid4().hex
|
QOS_POLICY_NAME = 'qos_policy_' + uuid.uuid4().hex
|
||||||
@ -31,6 +31,7 @@ class NetworkQosRuleTestsMinimumBandwidth(base.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
common.NetworkTests.setUpClass()
|
||||||
opts = cls.get_opts(cls.FIELDS)
|
opts = cls.get_opts(cls.FIELDS)
|
||||||
cls.openstack('network qos policy create ' + cls.QOS_POLICY_NAME)
|
cls.openstack('network qos policy create ' + cls.QOS_POLICY_NAME)
|
||||||
cls.RULE_ID = cls.openstack('network qos rule create --type ' +
|
cls.RULE_ID = cls.openstack('network qos rule create --type ' +
|
||||||
@ -46,20 +47,26 @@ class NetworkQosRuleTestsMinimumBandwidth(base.TestCase):
|
|||||||
cls.openstack('network qos policy delete ' + cls.QOS_POLICY_NAME)
|
cls.openstack('network qos policy delete ' + cls.QOS_POLICY_NAME)
|
||||||
cls.assertOutput('', raw_output)
|
cls.assertOutput('', raw_output)
|
||||||
|
|
||||||
def test_qos_policy_list(self):
|
def setUp(self):
|
||||||
|
super(NetworkQosRuleTestsMinimumBandwidth, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
|
def test_qos_rule_list(self):
|
||||||
opts = self.get_opts(self.HEADERS)
|
opts = self.get_opts(self.HEADERS)
|
||||||
raw_output = self.openstack('network qos rule list '
|
raw_output = self.openstack('network qos rule list '
|
||||||
+ self.QOS_POLICY_NAME + opts)
|
+ self.QOS_POLICY_NAME + opts)
|
||||||
self.assertIn(self.RULE_ID, raw_output)
|
self.assertIn(self.RULE_ID, raw_output)
|
||||||
|
|
||||||
def test_qos_policy_show(self):
|
def test_qos_rule_show(self):
|
||||||
opts = self.get_opts(self.FIELDS)
|
opts = self.get_opts(self.FIELDS)
|
||||||
raw_output = self.openstack('network qos rule show ' +
|
raw_output = self.openstack('network qos rule show ' +
|
||||||
self.QOS_POLICY_NAME + ' ' + self.RULE_ID +
|
self.QOS_POLICY_NAME + ' ' + self.RULE_ID +
|
||||||
opts)
|
opts)
|
||||||
self.assertEqual(self.RULE_ID, raw_output)
|
self.assertEqual(self.RULE_ID, raw_output)
|
||||||
|
|
||||||
def test_qos_policy_set(self):
|
def test_qos_rule_set(self):
|
||||||
self.openstack('network qos rule set --min-kbps ' +
|
self.openstack('network qos rule set --min-kbps ' +
|
||||||
str(self.MIN_KBPS_MODIFIED) + ' ' +
|
str(self.MIN_KBPS_MODIFIED) + ' ' +
|
||||||
self.QOS_POLICY_NAME + ' ' + self.RULE_ID)
|
self.QOS_POLICY_NAME + ' ' + self.RULE_ID)
|
||||||
@ -70,7 +77,7 @@ class NetworkQosRuleTestsMinimumBandwidth(base.TestCase):
|
|||||||
self.assertEqual(str(self.MIN_KBPS_MODIFIED) + "\n", raw_output)
|
self.assertEqual(str(self.MIN_KBPS_MODIFIED) + "\n", raw_output)
|
||||||
|
|
||||||
|
|
||||||
class NetworkQosRuleTestsDSCPMarking(base.TestCase):
|
class NetworkQosRuleTestsDSCPMarking(common.NetworkTests):
|
||||||
"""Functional tests for QoS DSCP marking rule."""
|
"""Functional tests for QoS DSCP marking rule."""
|
||||||
RULE_ID = None
|
RULE_ID = None
|
||||||
QOS_POLICY_NAME = 'qos_policy_' + uuid.uuid4().hex
|
QOS_POLICY_NAME = 'qos_policy_' + uuid.uuid4().hex
|
||||||
@ -82,6 +89,7 @@ class NetworkQosRuleTestsDSCPMarking(base.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
common.NetworkTests.setUpClass()
|
||||||
opts = cls.get_opts(cls.FIELDS)
|
opts = cls.get_opts(cls.FIELDS)
|
||||||
cls.openstack('network qos policy create ' + cls.QOS_POLICY_NAME)
|
cls.openstack('network qos policy create ' + cls.QOS_POLICY_NAME)
|
||||||
cls.RULE_ID = cls.openstack('network qos rule create --type ' +
|
cls.RULE_ID = cls.openstack('network qos rule create --type ' +
|
||||||
@ -97,20 +105,26 @@ class NetworkQosRuleTestsDSCPMarking(base.TestCase):
|
|||||||
cls.openstack('network qos policy delete ' + cls.QOS_POLICY_NAME)
|
cls.openstack('network qos policy delete ' + cls.QOS_POLICY_NAME)
|
||||||
cls.assertOutput('', raw_output)
|
cls.assertOutput('', raw_output)
|
||||||
|
|
||||||
def test_qos_policy_list(self):
|
def setUp(self):
|
||||||
|
super(NetworkQosRuleTestsDSCPMarking, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
|
def test_qos_rule_list(self):
|
||||||
opts = self.get_opts(self.HEADERS)
|
opts = self.get_opts(self.HEADERS)
|
||||||
raw_output = self.openstack('network qos rule list '
|
raw_output = self.openstack('network qos rule list '
|
||||||
+ self.QOS_POLICY_NAME + opts)
|
+ self.QOS_POLICY_NAME + opts)
|
||||||
self.assertIn(self.RULE_ID, raw_output)
|
self.assertIn(self.RULE_ID, raw_output)
|
||||||
|
|
||||||
def test_qos_policy_show(self):
|
def test_qos_rule_show(self):
|
||||||
opts = self.get_opts(self.FIELDS)
|
opts = self.get_opts(self.FIELDS)
|
||||||
raw_output = self.openstack('network qos rule show ' +
|
raw_output = self.openstack('network qos rule show ' +
|
||||||
self.QOS_POLICY_NAME + ' ' + self.RULE_ID +
|
self.QOS_POLICY_NAME + ' ' + self.RULE_ID +
|
||||||
opts)
|
opts)
|
||||||
self.assertEqual(self.RULE_ID, raw_output)
|
self.assertEqual(self.RULE_ID, raw_output)
|
||||||
|
|
||||||
def test_qos_policy_set(self):
|
def test_qos_rule_set(self):
|
||||||
self.openstack('network qos rule set --dscp-mark ' +
|
self.openstack('network qos rule set --dscp-mark ' +
|
||||||
str(self.DSCP_MARK_MODIFIED) + ' ' +
|
str(self.DSCP_MARK_MODIFIED) + ' ' +
|
||||||
self.QOS_POLICY_NAME + ' ' + self.RULE_ID)
|
self.QOS_POLICY_NAME + ' ' + self.RULE_ID)
|
||||||
@ -121,7 +135,7 @@ class NetworkQosRuleTestsDSCPMarking(base.TestCase):
|
|||||||
self.assertEqual(str(self.DSCP_MARK_MODIFIED) + "\n", raw_output)
|
self.assertEqual(str(self.DSCP_MARK_MODIFIED) + "\n", raw_output)
|
||||||
|
|
||||||
|
|
||||||
class NetworkQosRuleTestsBandwidthLimit(base.TestCase):
|
class NetworkQosRuleTestsBandwidthLimit(common.NetworkTests):
|
||||||
"""Functional tests for QoS bandwidth limit rule."""
|
"""Functional tests for QoS bandwidth limit rule."""
|
||||||
RULE_ID = None
|
RULE_ID = None
|
||||||
QOS_POLICY_NAME = 'qos_policy_' + uuid.uuid4().hex
|
QOS_POLICY_NAME = 'qos_policy_' + uuid.uuid4().hex
|
||||||
@ -135,6 +149,7 @@ class NetworkQosRuleTestsBandwidthLimit(base.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
common.NetworkTests.setUpClass()
|
||||||
opts = cls.get_opts(cls.FIELDS)
|
opts = cls.get_opts(cls.FIELDS)
|
||||||
cls.openstack('network qos policy create ' + cls.QOS_POLICY_NAME)
|
cls.openstack('network qos policy create ' + cls.QOS_POLICY_NAME)
|
||||||
cls.RULE_ID = cls.openstack('network qos rule create --type ' +
|
cls.RULE_ID = cls.openstack('network qos rule create --type ' +
|
||||||
@ -151,20 +166,26 @@ class NetworkQosRuleTestsBandwidthLimit(base.TestCase):
|
|||||||
cls.openstack('network qos policy delete ' + cls.QOS_POLICY_NAME)
|
cls.openstack('network qos policy delete ' + cls.QOS_POLICY_NAME)
|
||||||
cls.assertOutput('', raw_output)
|
cls.assertOutput('', raw_output)
|
||||||
|
|
||||||
def test_qos_policy_list(self):
|
def setUp(self):
|
||||||
|
super(NetworkQosRuleTestsBandwidthLimit, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
|
def test_qos_rule_list(self):
|
||||||
opts = self.get_opts(self.HEADERS)
|
opts = self.get_opts(self.HEADERS)
|
||||||
raw_output = self.openstack('network qos rule list '
|
raw_output = self.openstack('network qos rule list '
|
||||||
+ self.QOS_POLICY_NAME + opts)
|
+ self.QOS_POLICY_NAME + opts)
|
||||||
self.assertIn(self.RULE_ID, raw_output)
|
self.assertIn(self.RULE_ID, raw_output)
|
||||||
|
|
||||||
def test_qos_policy_show(self):
|
def test_qos_rule_show(self):
|
||||||
opts = self.get_opts(self.FIELDS)
|
opts = self.get_opts(self.FIELDS)
|
||||||
raw_output = self.openstack('network qos rule show ' +
|
raw_output = self.openstack('network qos rule show ' +
|
||||||
self.QOS_POLICY_NAME + ' ' + self.RULE_ID +
|
self.QOS_POLICY_NAME + ' ' + self.RULE_ID +
|
||||||
opts)
|
opts)
|
||||||
self.assertEqual(self.RULE_ID, raw_output)
|
self.assertEqual(self.RULE_ID, raw_output)
|
||||||
|
|
||||||
def test_qos_policy_set(self):
|
def test_qos_rule_set(self):
|
||||||
self.openstack('network qos rule set --max-kbps ' +
|
self.openstack('network qos rule set --max-kbps ' +
|
||||||
str(self.MAX_KBPS_MODIFIED) + ' --max-burst-kbits ' +
|
str(self.MAX_KBPS_MODIFIED) + ' --max-burst-kbits ' +
|
||||||
str(self.MAX_BURST_KBITS_MODIFIED) + ' ' +
|
str(self.MAX_BURST_KBITS_MODIFIED) + ' ' +
|
||||||
|
@ -13,15 +13,21 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class NetworkQosRuleTypeTests(base.TestCase):
|
class NetworkQosRuleTypeTests(common.NetworkTests):
|
||||||
"""Functional tests for Network QoS rule type. """
|
"""Functional tests for Network QoS rule type. """
|
||||||
|
|
||||||
AVAILABLE_RULE_TYPES = ['dscp_marking',
|
AVAILABLE_RULE_TYPES = ['dscp_marking',
|
||||||
'bandwidth_limit']
|
'bandwidth_limit']
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(NetworkQosRuleTypeTests, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
def test_qos_rule_type_list(self):
|
def test_qos_rule_type_list(self):
|
||||||
raw_output = self.openstack('network qos rule type list')
|
raw_output = self.openstack('network qos rule type list')
|
||||||
for rule_type in self.AVAILABLE_RULE_TYPES:
|
for rule_type in self.AVAILABLE_RULE_TYPES:
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class NetworkRBACTests(base.TestCase):
|
class NetworkRBACTests(common.NetworkTests):
|
||||||
"""Functional tests for network rbac. """
|
"""Functional tests for network rbac. """
|
||||||
NET_NAME = uuid.uuid4().hex
|
NET_NAME = uuid.uuid4().hex
|
||||||
PROJECT_NAME = uuid.uuid4().hex
|
PROJECT_NAME = uuid.uuid4().hex
|
||||||
@ -26,24 +26,41 @@ class NetworkRBACTests(base.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
opts = cls.get_opts(cls.FIELDS)
|
common.NetworkTests.setUpClass()
|
||||||
raw_output = cls.openstack('network create ' + cls.NET_NAME + opts)
|
if cls.haz_network:
|
||||||
cls.OBJECT_ID = raw_output.strip('\n')
|
opts = cls.get_opts(cls.FIELDS)
|
||||||
opts = cls.get_opts(['id', 'object_id'])
|
raw_output = cls.openstack(
|
||||||
raw_output = cls.openstack('network rbac create ' +
|
'network create ' + cls.NET_NAME + opts
|
||||||
cls.OBJECT_ID +
|
)
|
||||||
' --action access_as_shared' +
|
cls.OBJECT_ID = raw_output.strip('\n')
|
||||||
' --target-project admin' +
|
opts = cls.get_opts(['id', 'object_id'])
|
||||||
' --type network' + opts)
|
raw_output = cls.openstack(
|
||||||
cls.ID, object_id, rol = tuple(raw_output.split('\n'))
|
'network rbac create ' +
|
||||||
cls.assertOutput(cls.OBJECT_ID, object_id)
|
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
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
raw_output_rbac = cls.openstack('network rbac delete ' + cls.ID)
|
if cls.haz_network:
|
||||||
raw_output_network = cls.openstack('network delete ' + cls.OBJECT_ID)
|
raw_output_rbac = cls.openstack(
|
||||||
cls.assertOutput('', raw_output_rbac)
|
'network rbac delete ' + cls.ID
|
||||||
cls.assertOutput('', raw_output_network)
|
)
|
||||||
|
raw_output_network = cls.openstack(
|
||||||
|
'network delete ' + cls.OBJECT_ID
|
||||||
|
)
|
||||||
|
cls.assertOutput('', raw_output_rbac)
|
||||||
|
cls.assertOutput('', raw_output_network)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(NetworkRBACTests, self).setUp()
|
||||||
|
# Nothing in this class works with Nova Network
|
||||||
|
if not self.haz_network:
|
||||||
|
self.skipTest("No Network service present")
|
||||||
|
|
||||||
def test_network_rbac_list(self):
|
def test_network_rbac_list(self):
|
||||||
opts = self.get_opts(self.HEADERS)
|
opts = self.get_opts(self.HEADERS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user