From 6006ccd83b77cd756e1f4f81d4a1db0828ebad9e Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 18 Jul 2018 16:00:13 +0100 Subject: [PATCH] [placement] cover bad content-length header The main dispatch handler in placement checks to see if the content-length header is a valid int and returns a 400 status code if not. There had been no gabbi coverage for this behavior. This patch adds that coverage. Change-Id: If12fc7e374c7933bd2f10beb4be3e0a8d8e622e9 --- .../api/openstack/placement/gabbits/basic-http.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nova/tests/functional/api/openstack/placement/gabbits/basic-http.yaml b/nova/tests/functional/api/openstack/placement/gabbits/basic-http.yaml index 28ee38210bac..584d1eeb7148 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/basic-http.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/basic-http.yaml @@ -194,3 +194,14 @@ tests: content-type: application/json response_json_paths: $.errors[0].title: Not Found + +- name: bad content length not int + POST: /resource_providers + request_headers: + content-type: application/json + content-length: hi mom + data: + uuid: ce13d7f1-9988-4dfd-8e16-ce071802eb36 + status: 400 + response_strings: + - content-length header must be an integer