Merge "Use class-level skips when necessary"

This commit is contained in:
Zuul 2018-07-25 14:20:17 +00:00 committed by Gerrit Code Review
commit 5581095553
2 changed files with 16 additions and 10 deletions

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import testtools
import time
from tempest import config
@ -27,11 +26,15 @@ CONF = config.CONF
class TestKuryrRestartScenario(base.BaseKuryrScenarioTest):
@testtools.skipUnless(
CONF.kuryr_kubernetes.containerized and
CONF.kuryr_kubernetes.run_tests_serial,
"CNI and controller should be containerized and this test should run "
"on gate, configured to run sequentially")
@classmethod
def skip_checks(cls):
super(TestKuryrRestartScenario, cls).skip_checks()
if (not CONF.kuryr_kubernetes.containerized or
not CONF.kuryr_kubernetes.run_tests_serial):
raise cls.skipException(
"CNI and controller should be containerized and this test "
"should run on gate, configured to run sequentially.")
@decorators.idempotent_id('bddf5441-1244-449d-a125-b5fdcfb1a1a7')
def test_kuryr_pod_delete(self):
# find kuryr CNI and controller pods, delete them one by one and create

View File

@ -15,7 +15,6 @@
from oslo_log import log as logging
from tempest import config
from tempest.lib import decorators
import testtools
from kuryr_tempest_plugin.tests.scenario import base
@ -25,9 +24,13 @@ CONF = config.CONF
class TestPortPoolScenario(base.BaseKuryrScenarioTest):
@testtools.skipUnless(
CONF.kuryr_kubernetes.port_pool_enabled,
"Port pool feature should be enabled to run this test")
@classmethod
def skip_checks(cls):
super(TestPortPoolScenario, cls).skip_checks()
if not CONF.kuryr_kubernetes.port_pool_enabled:
raise cls.skipException(
"Port pool feature should be enabled to run this test.")
@decorators.idempotent_id('bddf5441-1244-449d-a125-b5fddfb1a3aa')
def test_port_pool(self):
# check the original length of list of ports