Allow lower case for queries with state and severity

Add tests to validate. Change some tempest tests to validate.

Change-Id: I92bcf8fc8f1605dcf3a291b3fd224d930f96b1f0
This commit is contained in:
Craig Bryant 2017-01-24 21:19:58 -07:00
parent 47ee3f7556
commit dd84f548ce
3 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development Company LP
# (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
#
# 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
@ -426,7 +426,7 @@ class TestAlarmDefinitions(base.BaseMonascaTest):
name=name,
description="description",
expression=expression,
severity="LOW")
severity="low")
resp, res_body_create_alarm_def = self.monasca_client.\
create_alarm_definitions(alarm_definition)
self.assertEqual(201, resp.status)

View File

@ -1,4 +1,4 @@
# (C) Copyright 2015-2016 Hewlett Packard Enterprise Development Company LP
# (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
#
# 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
@ -252,7 +252,7 @@ class TestAlarms(base.BaseMonascaTest):
resp, response_body1 = self.monasca_client.list_alarms(query_parms)
len1 = len(response_body1['elements'])
self.assertEqual(200, resp.status)
query_parms = '?state=OK'
query_parms = '?state=ok'
resp, response_body2 = self.monasca_client.list_alarms(query_parms)
len2 = len(response_body2['elements'])
self.assertEqual(200, resp.status)

View File

@ -1,4 +1,4 @@
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
#
# 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
@ -194,7 +194,7 @@ class TestAlarmsCount(base.BaseMonascaTest):
resp, response_body = self.monasca_client.list_alarms("?state=ALARM")
self.assertEqual(200, resp.status)
alarm_state_count = len(response_body['elements'])
resp, response_body = self.monasca_client.list_alarms("?state=UNDETERMINED")
resp, response_body = self.monasca_client.list_alarms("?state=undetermined")
self.assertEqual(200, resp.status)
undet_state_count = len(response_body['elements'])
@ -235,7 +235,7 @@ class TestAlarmsCount(base.BaseMonascaTest):
# test with filter parameters
@test.attr(type='gate')
def test_filter_params(self):
resp, response_body = self.monasca_client.list_alarms("?severity=LOW")
resp, response_body = self.monasca_client.list_alarms("?severity=low")
self.assertEqual(200, resp.status)
expected_count = len(response_body['elements'])