Check valid values for start_time and end_time

* Add test to check values stored for action start_time and end_time
* Enable test case after fixing bug #1746123

Depends-On: https://review.openstack.org/#/c/554385/
Change-Id: I7e9a8219fb9e6ea8ff20a7540a6a995f1a9dd9be
This commit is contained in:
Duc Truong 2018-03-19 22:28:34 +00:00
parent 3ac3092ffd
commit efd449fd6f
2 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import time
from tempest.lib import decorators
from senlin_tempest_plugin.common import utils
@ -23,6 +25,7 @@ class TestActionShow(base.BaseSenlinAPITest):
profile_id = utils.create_a_profile(self)
self.addCleanup(utils.delete_a_profile, self, profile_id)
self.lower_time_bound = time.time()
params = {
'cluster': {
'profile_id': profile_id,
@ -39,6 +42,7 @@ class TestActionShow(base.BaseSenlinAPITest):
self.addCleanup(utils.delete_a_cluster, self, res['body']['id'])
self.client.wait_for_status('actions', self.action_id, 'SUCCEEDED')
self.upper_time_bound = time.time()
@decorators.idempotent_id('c6376f60-8f52-4384-8b6d-57df264f2e23')
def test_action_show(self):
@ -55,3 +59,11 @@ class TestActionShow(base.BaseSenlinAPITest):
'start_time', 'status', 'status_reason', 'target',
'timeout', 'updated_at']:
self.assertIn(key, action)
for key in ['start_time', 'end_time']:
self.assertTrue(action[key] > self.lower_time_bound,
'{} is smaller than {}'.format(
action[key], self.lower_time_bound))
self.assertTrue(action[key] < self.upper_time_bound,
'{} is larger than {}'.format(
action[key], self.upper_time_bound))

View File

@ -108,7 +108,6 @@ class TestDeletionPolicy(base.BaseSenlinFunctionalTest):
@decorators.attr(type=['functional'])
@decorators.idempotent_id('88ea4617-10a6-4005-a641-b9459418661f')
@decorators.skip_because(bug="1746123")
def test_deletion_policy_with_hook_timeout(self):
# Create a deletion policy with hook
spec = constants.spec_deletion_policy_with_hook