TestStampPattern fails to call create_server correctly

Bug #1542527 reported by Brian Dols on 2016-02-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

TestStampPattern can be a guide for those who wish to do an integration test that writes data to an attached volume.

The call to create_server in ScenarioTestCase passes in the full security_group object and causes this failure:

2016-02-03 11:32:31.244 8560 INFO tempest_lib.common.rest_client [req-f8e12d6c-5545-483b-b8dc-3b56e6b6a810 ] Request (TestStampPattern:test_stamp_pattern): 400 POST https://dal-api.sftlyr.ws:8774/v2/ab73c84264394c63b3a33a720119ea85/servers 0.505s
2016-02-03 11:32:31.244 8560 DEBUG tempest_lib.common.rest_client [req-f8e12d6c-5545-483b-b8dc-3b56e6b6a810 ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"server": {"name": "tempest.common.compute-instance-1636538466", "imageRef": "74c365c5-5ab6-4b3f-be6e-afb3b0421a6e", "key_name": "tempest-TestStampPattern-1948458251", "flavorRef": "1", "networks": [{"uuid": "9a85c20d-f44d-4cf4-880d-d4fb5f0d74ee"}], "security_groups": {"rules": [], "tenant_id": "ab73c84264394c63b3a33a720119ea85", "description": "tempest-TestStampPattern-1967360540 description", "name": "tempest-TestStampPattern-1967360540", "id": "a4f7e8cb-c84f-45f8-9c9d-aff669f1d529"}}}
    Response - Headers: {'status': '400', 'content-length': '334', 'x-compute-request-id': 'req-f8e12d6c-5545-483b-b8dc-3b56e6b6a810', 'connection': 'keep-alive', 'date': 'Wed, 03 Feb 2016 17:32:31 GMT', 'content-type': 'application/json; charset=UTF-8'}
        Body: {"badRequest": {"message": "Invalid input for field/attribute security_groups. Value: {u'rules': [], u'tenant_id': u'ab73c84264394c63b3a33a720119ea85', u'id': u'a4f7e8cb-c84f-45f8-9c9d-aff669f1d529', u'description': u'tempest-TestStampPattern-1967360540 description', u'name': u'tempest-TestStampPattern-1967360540'}. ", "code": 400}} _log_request_full /home/bdols/repos/upstream-tempest/.venv/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py:414

The solution, as seen conventionally in other calls, is to do the following:

diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 4e01de8..5470fe4 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -105,14 +102,13 @@ class TestStampPattern(manager.NetworkScenarioTest):
         # prepare for booting an instance
         keypair = self.create_keypair()
         security_group = self._create_security_group()
- security_groups = [{'name': security_group['name']}]

         # boot an instance and create a timestamp file in it
         volume = self.create_volume()
         server = self.create_server(
- security_groups=security_groups,
+ security_groups=security_group,

Changed in tempest:
status: New → Confirmed

This bug at the moment is being blocked by bug https://bugs.launchpad.net/tempest/+bug/1205344
Looks like the patches that are being proposed for fixing bug 1205344 already include the fix for this bug, so I guess this bug can also be closed once https://bugs.launchpad.net/tempest/+bug/1205344 gets merged.

This is the patch set that includes a fix for this: https://review.openstack.org/#/c/218355/23

chandan kumar (chkumar246) wrote :

@castulo, The above review is abandoned, If it is a bug, feel free to take it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers