Tweaking forgotten test
diff --git a/acceptance/openstack/compute/v2/secgroup_test.go b/acceptance/openstack/compute/v2/secgroup_test.go
index 3163d88..53d84ff 100644
--- a/acceptance/openstack/compute/v2/secgroup_test.go
+++ b/acceptance/openstack/compute/v2/secgroup_test.go
@@ -41,7 +41,7 @@
deleteSecGroup(t, client, groupID)
}
-func createSecGroup(t *testing.T, client *gophercloud.ServiceClient) string {
+func createSecGroup(t *testing.T, client *gophercloud.ServiceClient) int {
opts := secgroups.CreateOpts{
Name: tools.RandomString("secgroup_", 5),
Description: "something",
@@ -71,22 +71,25 @@
th.AssertNoErr(t, err)
}
-func updateSecGroup(t *testing.T, client *gophercloud.ServiceClient, id, newName string) {
- opts := secgroups.UpdateOpts{Name: newName}
+func updateSecGroup(t *testing.T, client *gophercloud.ServiceClient, id int, newName string) {
+ opts := secgroups.UpdateOpts{
+ Name: newName,
+ Description: tools.RandomString("dec_", 10),
+ }
group, err := secgroups.Update(client, id, opts).Extract()
th.AssertNoErr(t, err)
t.Logf("Updated %s's name to %s", group.ID, group.Name)
}
-func getSecGroup(t *testing.T, client *gophercloud.ServiceClient, id string) {
+func getSecGroup(t *testing.T, client *gophercloud.ServiceClient, id int) {
group, err := secgroups.Get(client, id).Extract()
th.AssertNoErr(t, err)
- t.Logf("Getting %s: %#v", id, group)
+ t.Logf("Getting %d: %#v", id, group)
}
-func addRemoveRules(t *testing.T, client *gophercloud.ServiceClient, id string) {
+func addRemoveRules(t *testing.T, client *gophercloud.ServiceClient, id int) {
opts := secgroups.CreateRuleOpts{
ParentGroupID: id,
FromPort: 22,
@@ -98,12 +101,12 @@
rule, err := secgroups.CreateRule(client, opts).Extract()
th.AssertNoErr(t, err)
- t.Logf("Adding rule %s to group %s", rule.ID, id)
+ t.Logf("Adding rule %d to group %d", rule.ID, id)
err = secgroups.DeleteRule(client, rule.ID).ExtractErr()
th.AssertNoErr(t, err)
- t.Logf("Deleted rule %s from group %s", rule.ID, id)
+ t.Logf("Deleted rule %d from group %d", rule.ID, id)
}
func findServer(t *testing.T, client *gophercloud.ServiceClient) (string, bool) {
@@ -166,9 +169,9 @@
t.Logf("Removing group %s from server %s", groupName, serverID)
}
-func deleteSecGroup(t *testing.T, client *gophercloud.ServiceClient, id string) {
+func deleteSecGroup(t *testing.T, client *gophercloud.ServiceClient, id int) {
err := secgroups.Delete(client, id).ExtractErr()
th.AssertNoErr(t, err)
- t.Logf("Deleted group %s", id)
+ t.Logf("Deleted group %d", id)
}