File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/testing/integration/Networking/v2/Layer3 Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Diagnostics ;
3+ using System . Linq ;
34using System . Threading . Tasks ;
45using OpenStack . Compute . v2_1 ;
56using 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}
You can’t perform that action at this time.
0 commit comments