no testcases to cover the region creation with invalid id

Bug #1487663 reported by Dave Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Dave Chen

Bug Description

Regions use ID differently. The user can specify the ID or it will be generated automatically. Region schema validation require the Region ID is string type, but there is no testcase to cover this.

CURL
=====================================================================
- create region,
curl -g -i -X POST http://127.0.0.1:35357/v3/regions -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 9b7866d88de2408381549e9af55b0c07" -d '{"region": {"enabled": true, "id": 1234}}'

{"error": {"message": "Invalid input for field 'id'. The value is '1234'.", "code": 400, "title": "Bad Request"}}

- create endpoint,
curl -g -i -X POST http://127.0.0.1:35357/v3/endpoints -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: af9a74ea521045b2880e2a364a16b05a" -d '{"endpoint": {"url": "192.168.1.1:78", "interface": "public", "region": 7891, "enabled": true, "service_id": "ce08ac9579fc4de78d0ee17efeca530e"}}'

{"error": {"message": "Invalid input for field 'region'. The value is '7891'.", "code": 400, "title": "Bad Request"}}

Dave Chen (wei-d-chen)
description: updated
Dave Chen (wei-d-chen)
Changed in keystone:
assignee: nobody → Dave Chen (wei-d-chen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/215878

Changed in keystone:
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
tags: added: test-improvement
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/215878
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=0b4f585fdd1c0bba39232f856ad630e3d3dbf235
Submitter: Jenkins
Branch: master

commit 0b4f585fdd1c0bba39232f856ad630e3d3dbf235
Author: Dave Chen <email address hidden>
Date: Sat Aug 22 14:23:48 2015 +0800

    Add testcase to test invalid region id in request

    Regions use ID differently. The user can specify the ID or it will be
    generated automatically. So, there is schema validation that region ID
    should be the string type, these testcases test where region id could
    be passed in request body but not a string type.

    Change-Id: I0623e8e97132b9c2e60d03fca8fa98de798b5494
    Closes-Bug: #1487663

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: liberty-3 → 8.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.