From 5da190ff12a676bb8773127a0bb25a2120ef1e66 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Thu, 6 Jul 2017 17:04:51 +0000 Subject: [PATCH] [placement] Improve allocation_candidates coverage The case where a bad resource class in resources can cause a 400 response was not covered. This adds it; things work as desired. Change-Id: Ieb93889f76070b9ae37c082301488a953106d914 --- .../openstack/placement/gabbits/allocation-candidates.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nova/tests/functional/api/openstack/placement/gabbits/allocation-candidates.yaml b/nova/tests/functional/api/openstack/placement/gabbits/allocation-candidates.yaml index b65f6fe53707..86a8249718d0 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/allocation-candidates.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/allocation-candidates.yaml @@ -39,6 +39,12 @@ tests: response_strings: - "'resources' is a required property" +- name: get bad resource class + GET: /allocation_candidates?resources=MCPU:99 + status: 400 + response_strings: + - Invalid resource class in resources parameter + - name: get allocation candidates no allocations yet GET: /allocation_candidates?resources=VCPU:1,MEMORY_MB:1024,DISK_GB:100 status: 200