diff --git a/ceilometer/tests/functional/api/v2/test_alarm_scenarios.py b/ceilometer/tests/functional/api/v2/test_alarm_scenarios.py index f036844fdb..0dfdb6cf2e 100644 --- a/ceilometer/tests/functional/api/v2/test_alarm_scenarios.py +++ b/ceilometer/tests/functional/api/v2/test_alarm_scenarios.py @@ -859,8 +859,8 @@ class TestAlarms(v2.FunctionalTest, } resp = self.post_json('/alarms', params=json, expect_errors=True, status=400, headers=self.auth_headers) - expected_error_message = ("Invalid input for field/attribute field. " - "Value: 'None'. Mandatory field missing.") + expected_error_message = ("Unknown attribute for argument " + "data.threshold_rule.query: q.field") fault_string = resp.json['error_message']['faultstring'] self.assertEqual(expected_error_message, fault_string) alarms = list(self.alarm_conn.get_alarms()) @@ -879,8 +879,8 @@ class TestAlarms(v2.FunctionalTest, } resp = self.post_json('/alarms', params=json, expect_errors=True, status=400, headers=self.auth_headers) - expected_error_message = ("Invalid input for field/attribute value. " - "Value: 'None'. Mandatory field missing.") + expected_error_message = ("Unknown attribute for argument " + "data.threshold_rule.query: q.value") fault_string = resp.json['error_message']['faultstring'] self.assertEqual(expected_error_message, fault_string) alarms = list(self.alarm_conn.get_alarms()) @@ -1946,8 +1946,6 @@ class TestAlarms(v2.FunctionalTest, self._verify_alarm(json, alarm) def test_put_alarm_wrong_field(self): - # Note: wsme will ignore unknown fields so will just not appear in - # the Alarm. json = { 'this_can_not_be_correct': 'ha', 'enabled': False, @@ -1980,9 +1978,10 @@ class TestAlarms(v2.FunctionalTest, alarm_id = data[0]['alarm_id'] resp = self.put_json('/alarms/%s' % alarm_id, + expect_errors=True, params=json, headers=self.auth_headers) - self.assertEqual(200, resp.status_code) + self.assertEqual(400, resp.status_code) def test_put_alarm_with_existing_name(self): """Test that update a threshold alarm with an existing name.""" diff --git a/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml b/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml index ed9f1b972a..c52f6fe8c6 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml @@ -79,7 +79,6 @@ tests: # this attempts to query the events with the wrong data query syntax missing the # q object but supplying the field list and a bad field name and expects a 400 - name: get events that match bad query via request data malformed list - desc: https://bugs.launchpad.net/ceilometer/+bug/1423634 url: /v2/events request_headers: content-type: application/json; charset=UTF-8 @@ -88,21 +87,18 @@ tests: op: eq type: string value: cookies_chocolate.chip - xfail: True status: 400 # this attempts to query the events with the wrong data query syntax missing the # q object but supplying the field list along with a bad content-type. Should # return a 400 - name: get events that match bad query via request data wrong type - desc: https://bugs.launchpad.net/ceilometer/+bug/1423634 and https://bugs.launchpad.net/ceilometer/+bug/1424642 url: /v2/events request_headers: content-type: text/plain data: "field: bad_field op: eq type: string value: cookies_chocolate.chip xfail: True" - xfail: True - status: 400 + status: 415 # Get a single event by message_id no data is present so should return a 404 - name: get a single event diff --git a/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml b/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml index d87b3825e6..5cf8e164e8 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml @@ -91,7 +91,6 @@ tests: # this attempts to query the events with the wrong data query syntax missing the # q object but supplying the field list and a bad field name and expects a 400 - name: get events that match bad query via data list - desc: https://bugs.launchpad.net/ceilometer/+bug/1423634 url: /v2/events request_headers: content-type: application/json; charset=UTF-8 @@ -100,7 +99,6 @@ tests: op: eq type: string value: cookies_chocolate.chip - xfail: True status: 400 # Get a single event by message_id should return an event diff --git a/ceilometer/tests/functional/gabbi/gabbits/meters.yaml b/ceilometer/tests/functional/gabbi/gabbits/meters.yaml index f2f7918773..c19e293307 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/meters.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/meters.yaml @@ -76,18 +76,14 @@ tests: $.error_message.faultstring: "Samples should be included in request body" - name: post meter bad content-type - desc: https://bugs.launchpad.net/wsme/+bug/1419110 - xfail: true url: /v2/meters/apples?direct=True method: POST request_headers: content-type: text/plain data: hello - status: 400 + status: 415 - name: post bad samples to meter - desc: https://bugs.launchpad.net/ceilometer/+bug/1428185 - xfail: true url: /v2/meters/apples?direct=True method: POST request_headers: @@ -225,8 +221,6 @@ tests: # Explore posting samples with less than perfect data. - name: post counter with bad timestamp - desc: https://bugs.launchpad.net/wsme/+bug/1428624 - xfail: true url: /v2/meters/apples?direct=True method: POST request_headers: @@ -238,6 +232,9 @@ tests: counter_volume: 3 resource_id: aa9431c1-8d69-4ad3-803a-8d4a6b89fdaa timestamp: "2013-01-bad 23:23:20" + status: 400 + response_strings: + - 'Invalid input for field/attribute samples' - name: post counter with good timestamp url: /v2/meters/apples?direct=True @@ -254,8 +251,6 @@ tests: timestamp: "2013-01-01 23:23:20" - name: post counter with wrong metadata - desc: https://bugs.launchpad.net/ceilometer/+bug/1428628 - xfail: true url: /v2/meters/apples?direct=True method: POST request_headers: @@ -268,6 +263,9 @@ tests: resource_id: aa9431c1-8d69-4ad3-803a-8d4a6b89fdaa timestamp: "2013-01-01 23:23:20" resource_metadata: "a string" + status: 400 + response_strings: + - "Invalid input for field/attribute samples" - name: post counter with empty metadata url: /v2/meters/apples?direct=True @@ -347,8 +345,6 @@ tests: - "[]" - name: get sample statistics select aggregate bad format - desc: https://bugs.launchpad.net/wsme/+bug/1428658 - xfail: true url: /v2/meters/apples/statistics?aggregate=max status: 400