Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 9920d78

Browse files
committed
Merge pull request #1 from jtopjian/openstack-icmp-0
Adding acceptance test for ICMP types of 0
2 parents 98c77d0 + 2893f7b commit 9920d78

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

acceptance/openstack/compute/v2/secgroup_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ func addRemoveRules(t *testing.T, client *gophercloud.ServiceClient, id string)
107107
th.AssertNoErr(t, err)
108108

109109
t.Logf("Deleted rule %s from group %s", rule.ID, id)
110+
111+
icmpOpts := secgroups.CreateRuleOpts{
112+
ParentGroupID: id,
113+
FromPort: 0,
114+
ToPort: 0,
115+
IPProtocol: "ICMP",
116+
CIDR: "0.0.0.0/0",
117+
}
118+
119+
icmpRule, err := secgroups.CreateRule(client, icmpOpts).Extract()
120+
th.AssertNoErr(t, err)
121+
122+
t.Logf("Adding ICMP rule %s to group %s", icmpRule.ID, id)
123+
124+
err = secgroups.DeleteRule(client, icmpRule.ID).ExtractErr()
125+
th.AssertNoErr(t, err)
126+
127+
t.Logf("Deleted ICMP rule %s from group %s", icmpRule.ID, id)
110128
}
111129

112130
func findServer(t *testing.T, client *gophercloud.ServiceClient) (string, bool) {

0 commit comments

Comments
 (0)