tests: Handle missing extensions in network tests
Some tests still assume extensions are enabled; those tests are now skipped if the extension is not enabled. Change I25b8811fe09f2a4a9fc20ca5459f5a404b88a337 addressed some but not all of these. Change-Id: If36550650f143a7efe4190e60961c51a8cd20fb3
This commit is contained in:
parent
e44d8017ec
commit
6d3490ed7c
@ -15,9 +15,15 @@ import uuid
|
|||||||
from openstackclient.tests.functional.network.v2 import common
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
class NetworkAgentTests(common.NetworkTests):
|
class TestAgent(common.NetworkTests):
|
||||||
"""Functional tests for network agent"""
|
"""Functional tests for network agent"""
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
|
||||||
|
if not self.is_extension_enabled("agent"):
|
||||||
|
self.skipTest("No agent extension present")
|
||||||
|
|
||||||
def test_network_agent_list_show_set(self):
|
def test_network_agent_list_show_set(self):
|
||||||
"""Test network agent list, set, show commands
|
"""Test network agent list, set, show commands
|
||||||
|
|
||||||
@ -79,9 +85,15 @@ class NetworkAgentTests(common.NetworkTests):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class NetworkAgentListTests(common.NetworkTests):
|
class TestAgentList(common.NetworkTests):
|
||||||
"""Functional test for network agent"""
|
"""Functional test for network agent"""
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
|
||||||
|
if not self.is_extension_enabled("agent"):
|
||||||
|
self.skipTest("No agent extension present")
|
||||||
|
|
||||||
def test_network_dhcp_agent_list(self):
|
def test_network_dhcp_agent_list(self):
|
||||||
"""Test network agent list"""
|
"""Test network agent list"""
|
||||||
|
|
||||||
|
@ -21,6 +21,12 @@ from openstackclient.tests.functional.network.v2 import common
|
|||||||
class TestMeter(common.NetworkTests):
|
class TestMeter(common.NetworkTests):
|
||||||
"""Functional tests for network meter"""
|
"""Functional tests for network meter"""
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
|
||||||
|
if not self.is_extension_enabled("metering"):
|
||||||
|
self.skipTest("No metering extension present")
|
||||||
|
|
||||||
# NOTE(dtroyer): Do not normalize the setup and teardown of the resource
|
# NOTE(dtroyer): Do not normalize the setup and teardown of the resource
|
||||||
# creation and deletion. Little is gained when each test
|
# creation and deletion. Little is gained when each test
|
||||||
# has its own needs and there are collisions when running
|
# has its own needs and there are collisions when running
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import unittest
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openstackclient.tests.functional.network.v2 import common
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
@ -27,6 +28,10 @@ class TestMeterRule(common.NetworkTests):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super().setUpClass()
|
super().setUpClass()
|
||||||
|
|
||||||
|
if not cls.is_extension_enabled("metering"):
|
||||||
|
raise unittest.SkipTest("No metering extension present")
|
||||||
|
|
||||||
if cls.haz_network:
|
if cls.haz_network:
|
||||||
cls.METER_NAME = uuid.uuid4().hex
|
cls.METER_NAME = uuid.uuid4().hex
|
||||||
|
|
||||||
@ -47,12 +52,6 @@ class TestMeterRule(common.NetworkTests):
|
|||||||
finally:
|
finally:
|
||||||
super().tearDownClass()
|
super().tearDownClass()
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super().setUp()
|
|
||||||
|
|
||||||
if not self.is_extension_enabled("metering"):
|
|
||||||
self.skipTest("No metering extension present")
|
|
||||||
|
|
||||||
def test_meter_rule_delete(self):
|
def test_meter_rule_delete(self):
|
||||||
"""test create, delete"""
|
"""test create, delete"""
|
||||||
json_output = self.openstack(
|
json_output = self.openstack(
|
||||||
|
@ -21,6 +21,12 @@ from openstackclient.tests.functional.network.v2 import common
|
|||||||
class NetworkQosPolicyTests(common.NetworkTests):
|
class NetworkQosPolicyTests(common.NetworkTests):
|
||||||
"""Functional tests for QoS policy"""
|
"""Functional tests for QoS policy"""
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
|
||||||
|
if not self.is_extension_enabled("qos"):
|
||||||
|
self.skipTest("No qos extension present")
|
||||||
|
|
||||||
def test_qos_rule_create_delete(self):
|
def test_qos_rule_create_delete(self):
|
||||||
# This is to check the output of qos policy delete
|
# This is to check the output of qos policy delete
|
||||||
policy_name = uuid.uuid4().hex
|
policy_name = uuid.uuid4().hex
|
||||||
|
@ -29,6 +29,12 @@ class NetworkQosRuleTypeTests(common.NetworkTests):
|
|||||||
'minimum_packet_rate',
|
'minimum_packet_rate',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
|
||||||
|
if not self.is_extension_enabled("qos"):
|
||||||
|
self.skipTest("No qos extension present")
|
||||||
|
|
||||||
def test_qos_rule_type_list(self):
|
def test_qos_rule_type_list(self):
|
||||||
cmd_output = self.openstack(
|
cmd_output = self.openstack(
|
||||||
'network qos rule type list -f json',
|
'network qos rule type list -f json',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user