diff --git a/airship_tempest_plugin/hacking/checks.py b/airship_tempest_plugin/hacking/checks.py index 1491f2d..7108543 100644 --- a/airship_tempest_plugin/hacking/checks.py +++ b/airship_tempest_plugin/hacking/checks.py @@ -144,7 +144,7 @@ def no_rbac_rule_validation_decorator(physical_line, filename): """ global have_rbac_decorator - if ("airship_tempest_plugin/tests/api" in filename or + if ("airship_tempest_plugin/tests/api/rbac" in filename or "airship_tempest_plugin/tests/scenario" in filename): if RULE_VALIDATION_DECORATOR.match(physical_line): @@ -176,7 +176,7 @@ def no_rbac_test_suffix_in_test_class_name(physical_line, filename): """Check that RBAC class names end with "RbacTest" P102 """ - if "airship_tempest_plugin/tests/api" in filename: + if "airship_tempest_plugin/tests/api/rbac/" in filename: if filename.endswith('rbac_base.py'): return diff --git a/airship_tempest_plugin/tests/api/shipyard/test_actions.py b/airship_tempest_plugin/tests/api/shipyard/test_actions.py new file mode 100644 index 0000000..272d225 --- /dev/null +++ b/airship_tempest_plugin/tests/api/shipyard/test_actions.py @@ -0,0 +1,57 @@ +# Copyright 2018 AT&T Corp +# All Rights Reserved. +# +# 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. +# + +from airship_tempest_plugin.tests.api.shipyard import base + +from tempest.lib import decorators + + +class ActionsTest(base.BaseShipyardTest): + + def _get_action_id(self): + resp = self.shipyard_actions_client.list_actions() + self.assertTrue(len(resp[1]) > 0, + 'No actions available, nothing to test') + # get the response body + return resp[1]['id'] + + def _get_action_step_id(self): + resp = self.shipyard_actions_client.list_actions() + self.assertTrue(len(resp[1]) > 0, + 'No actions available, nothing to test') + return resp[1]['id'], resp[1]['steps'][0]['id'] + + @decorators.idempotent_id('94901561-7ad1-4e9c-8df8-afe3a7f63c09') + def test_list_actions(self): + """List of actions, Successful with response status 200""" + resp = self.shipyard_actions_client.list_actions() + self.assertTrue(len(resp[1]) > 0, + 'No actions available, nothing to test') + self.assertEqual(resp.response['status'], '200') + + @decorators.idempotent_id('b0d4c23a-d3a4-4a12-8e10-ac6f8a98d33e') + def test_get_action(self): + action_id = self._get_action_id() + """Get actions, Successful with response status 200""" + resp = self.shipyard_actions_client.get_action(action_id) + self.assertEqual(resp.response['status'], '200') + + @decorators.idempotent_id('a8bc9e6b-bfa3-4635-a1ec-0b9ddc9cb03f') + def test_get_action_step(self): + """Get actions step, Successful with response status 200""" + action_id, step_id = self._get_action_step_id() + resp = self.shipyard_actions_client.get_action_step(action_id, step_id) + self.assertEqual(resp.response['status'], '200')