Skip to content

Commit 4965b95

Browse files
committed
Add Security Group integration test
1 parent c1b5a2d commit 4965b95

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/testing/integration/Networking/v2/Layer3/Layer3ExtensionTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Diagnostics;
3+
using System.Linq;
34
using System.Threading.Tasks;
45
using OpenStack.Compute.v2_1;
56
using Xunit;
@@ -80,5 +81,26 @@ public async Task AssignFloatingIP()
8081
// 8. Disassociate the floating ip from the server
8182
await server.DisassociateFloatingIPAsync(floatingIP.FloatingIPAddress);
8283
}
84+
85+
[Fact]
86+
public async Task ListSecurityGroups()
87+
{
88+
var groups = await _networkingService.ListSecurityGroupsAsync(new SecurityGroupListOptions {Name = "default"});
89+
90+
Assert.NotEmpty(groups);
91+
92+
var defaultGroup = groups.First();
93+
Assert.NotNull(defaultGroup);
94+
Assert.NotNull(defaultGroup.Name);
95+
Assert.NotNull(defaultGroup.Description);
96+
Assert.NotNull(defaultGroup.Id);
97+
Assert.NotEmpty(defaultGroup.SecurityGroupRules);
98+
99+
var defaultRule = defaultGroup.SecurityGroupRules.First();
100+
Assert.NotNull(defaultRule.Id);
101+
Assert.NotNull(defaultRule.Direction);
102+
Assert.NotNull(defaultRule.Ethertype);
103+
Assert.NotNull(defaultRule.SecurityGroupId);
104+
}
83105
}
84106
}

0 commit comments

Comments
 (0)