Merge lp:~wallyworld/goose/nova-testdouble-default-secgroup into lp:goose

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: 114
Merged at revision: 114
Proposed branch: lp:~wallyworld/goose/nova-testdouble-default-secgroup
Merge into: lp:goose
Diff against target: 37 lines (+4/-4)
2 files modified
testservices/novaservice/service_http.go (+0/-4)
testservices/novaservice/service_http_test.go (+4/-0)
To merge this branch: bzr merge lp:~wallyworld/goose/nova-testdouble-default-secgroup
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+199923@code.launchpad.net

Commit message

The nova service test double was incorrectly ignoring the default security group when starting an instance. It assumed that the default group did not need to be in the list of groups specified when starting, but this is not the case.

Description of the change

The nova service test double was incorrectly ignoring the default security group when starting an instance. It assumed that the default group did not need to be in the list of groups specified when starting, but this is not the case.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'testservices/novaservice/service_http.go'
2--- testservices/novaservice/service_http.go 2013-11-25 05:52:30 +0000
3+++ testservices/novaservice/service_http.go 2013-12-23 00:01:12 +0000
4@@ -563,10 +563,6 @@
5 if len(req.Server.SecurityGroups) > 0 {
6 for _, group := range req.Server.SecurityGroups {
7 groupName := group["name"]
8- if groupName == "default" {
9- // assume default security group exists
10- continue
11- }
12 if sg, err := n.securityGroupByName(groupName); err != nil {
13 return noGroupError(groupName, n.TenantId)
14 } else {
15
16=== modified file 'testservices/novaservice/service_http_test.go'
17--- testservices/novaservice/service_http_test.go 2013-10-17 23:02:16 +0000
18+++ testservices/novaservice/service_http_test.go 2013-12-23 00:01:12 +0000
19@@ -666,6 +666,7 @@
20 s.service.removeServer(srv.Id)
21 req.Server.Name = "test2"
22 req.Server.SecurityGroups = []map[string]string{
23+ {"name": "default"},
24 {"name": "group1"},
25 {"name": "group2"},
26 }
27@@ -686,8 +687,11 @@
28 c.Assert(ok, Equals, true)
29 ok = s.service.hasServerSecurityGroup(srv.Id, "2")
30 c.Assert(ok, Equals, true)
31+ ok = s.service.hasServerSecurityGroup(srv.Id, "999")
32+ c.Assert(ok, Equals, true)
33 s.service.removeServerSecurityGroup(srv.Id, "1")
34 s.service.removeServerSecurityGroup(srv.Id, "2")
35+ s.service.removeServerSecurityGroup(srv.Id, "999")
36 s.service.removeServer(srv.Id)
37 }
38

Subscribers

People subscribed via source and target branches