Fix Nova API misimplementation for security groups
The Compute API reference [1] states that the 'description' parameter
is optional when creating a security group. Consequently, omitting this
parameter (or passing an empty string or a whitespace) is allowed.
This patch removes those verifications that should not exist so that
change I404dd30c7dac4b8a9e01cf2ea62fa404fdcce3de can pass Tempest
checks.
[1]: http://developer.openstack.org/api-ref-compute-v2-ext.html#createSecGroup
Change-Id: I504f00cecbd004f00b3553e8a23c2b3870405050
Related-Bug: #1434172
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index 2cf2e28..06e073d 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -89,15 +89,10 @@
@test.idempotent_id('777b6f14-aca9-4758-9e84-38783cfa58bc')
@test.services('network')
def test_security_group_create_with_invalid_group_description(self):
- # Negative test:Security Group should not be created with description
- # as an empty string/with white spaces/chars more than 255
+ # Negative test: Security Group should not be created with description
+ # longer than 255 chars. Empty description is allowed by the API
+ # reference, however.
s_name = data_utils.rand_name('securitygroup')
- # Create Security Group with empty string as description
- self.assertRaises(lib_exc.BadRequest,
- self.client.create_security_group, s_name, "")
- # Create Security Group with white space in description
- self.assertRaises(lib_exc.BadRequest,
- self.client.create_security_group, s_name, " ")
# Create Security Group with group description longer than 255 chars
s_description = 'description-'.ljust(260, '0')
self.assertRaises(lib_exc.BadRequest,