TestStampPattern fails to call create_server correctly

Bug #1542527 reported by Brian Dols
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Expired
Undecided
Unassigned

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(
             image_id=CONF.compute.image_ref,
             key_name=keypair['name'],
- security_groups=security_groups,
+ security_groups=security_group,
             wait_until='ACTIVE')

Changed in tempest:
status: New → Confirmed
Revision history for this message
Castulo J. Martinez (castulo-martinez) wrote :

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.

Revision history for this message
Castulo J. Martinez (castulo-martinez) wrote :

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

Revision history for this message
chandan kumar (chkumar246) wrote :

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

Revision history for this message
Paras Babbar (pbabbar) wrote :

We have not observed this issue, I would like to close this as 'Not a bug'. And there are couple changes we did in test_stamp_pattern.py that avoid using the volume name . So I am not sure if this is that's the one you were facing as well "https://bugs.launchpad.net/tempest/+bug/1205344" which is fixed already.

Thanks

Revision history for this message
Martin Kopec (mkopec) wrote :

Based on Paras comment and consideration that the bug is quite old and the code has changed a lot since then .. I'll mark it as Incomplete for now to give the reporter some time to check if the issue is still valid before we mark it as Invalid.

Changed in tempest:
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for tempest because there has been no activity for 60 days.]

Changed in tempest:
status: Incomplete → Expired
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.