Extends base network admin test

This commit modifies the base Kuryr test so it can rely on the neutron
base test functions.

Change-Id: I4720630881e0086feedf6f8082f7ef54ee498e13
This commit is contained in:
Daniel Mellado 2017-06-07 09:30:04 +00:00
parent 4e6f5f0fe6
commit a5ce631362
3 changed files with 10 additions and 8 deletions

View File

@ -14,25 +14,23 @@
import kubernetes
from tempest.api.network import base
from tempest import config
import tempest.test
CONF = config.CONF
class BaseKuryrTest(tempest.test.BaseTestCase):
credentials = ['primary']
class BaseAdminKuryrTest(base.BaseAdminNetworkTest):
@classmethod
def skip_checks(cls):
super(BaseKuryrTest, cls).skip_checks()
super(BaseAdminKuryrTest, cls).skip_checks()
if not CONF.service_available.kuryr:
raise cls.skipException('Kuryr support is required')
@classmethod
def resource_setup(cls):
super(BaseKuryrTest, cls).resource_setup()
super(BaseAdminKuryrTest, cls).resource_setup()
# TODO (dmellado): Config k8s client in a cleaner way
kubernetes.config.load_kube_config()
cls.k8s_client = kubernetes.client.CoreV1Api()

View File

@ -24,7 +24,7 @@ from tempest.lib import decorators
from kuryr_tempest_plugin.tests import base
class TestKuryr_tempest_plugin(base.BaseKuryrTest):
class TestKuryr_tempest_plugin(base.BaseAdminKuryrTest):
@decorators.idempotent_id('14990abd-76b4-476e-add2-321437d8cec5')
def test_something(self):

View File

@ -17,8 +17,12 @@ from tempest.lib import decorators
from kuryr_tempest_plugin.tests import base
from oslo_config import cfg
class PodTest(base.BaseKuryrTest):
CONF = cfg.CONF
class PodTest(base.BaseAdminKuryrTest):
def _list_pods(self):
pods = self.k8s_client.list_pod_for_all_namespaces(watch=False)