def test_create_security_group_quota_limit(self):
        for num in range(1, CONF.quota_security_groups):
            name = 'test%s' % num
            sg = security_group_request_template(name=name)
            res_dict = self.controller.create(self.req, {'security_group': sg})
            self.assertEqual(res_dict['security_group']['name'], name)

        sg = security_group_request_template()
        self.assertRaises(webob.exc.HTTPForbidden, self.controller.create,
                          self.req, {'security_group': sg})
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_security_groups.py/TestSecurityGroupsV21.test_create_security_group_quota_limit/original