@@ -188,7 +188,7 @@ def delete_nhg():
188
188
# Test scenario:
189
189
# - create a NHG and assert a NHG object doesn't get added to ASIC DB
190
190
# - delete a NHG and assert the newly created one is created in ASIC DB and its SAI ID changed
191
- def test_temporary_group_promotion ():
191
+ def temporary_group_promotion_test ():
192
192
# Add a new next hop group - it should create a temporary one instead
193
193
prev_nhgs = self .asic_db .get_keys (self .ASIC_NHG_STR )
194
194
nhg_index , _ = create_temp_nhg ()
@@ -221,7 +221,7 @@ def test_temporary_group_promotion():
221
221
222
222
# Test scenario:
223
223
# - update an existing NHG and assert the update is performed
224
- def test_group_update ():
224
+ def group_update_test ():
225
225
# Update a group
226
226
binary = self .gen_valid_binary ()
227
227
nhg_fvs = self .gen_nhg_fvs (binary )
@@ -239,7 +239,7 @@ def test_group_update():
239
239
240
240
# Test scenario:
241
241
# - create and delete a NHG while the ASIC DB is full and assert nothing changes
242
- def test_create_delete_temporary ():
242
+ def create_delete_temporary_test ():
243
243
# Create a new temporary group
244
244
nhg_index , _ = create_temp_nhg ()
245
245
time .sleep (1 )
@@ -257,7 +257,7 @@ def test_create_delete_temporary():
257
257
# - create a temporary NHG
258
258
# - update the NHG with a different number of members
259
259
# - delete a NHG and assert the new one is added and it has the updated number of members
260
- def test_update_temporary_group ():
260
+ def update_temporary_group_test ():
261
261
# Create a new temporary group
262
262
nhg_index , binary = create_temp_nhg ()
263
263
@@ -294,7 +294,7 @@ def test_update_temporary_group():
294
294
# - create a temporary NHG and update the route to point to it, asserting the route's SAI NHG ID changes
295
295
# - update the temporary NHG to contain completely different members and assert the SAI ID changes
296
296
# - delete a NHG and assert the temporary NHG is promoted and its SAI ID also changes
297
- def test_route_nhg_update ():
297
+ def route_nhg_update_test ():
298
298
# Add a route
299
299
nhg_index = gen_nhg_index (self .first_valid_nhg )
300
300
rt_fvs = swsscommon .FieldValuePairs ([('nexthop_group' , nhg_index )])
@@ -369,7 +369,7 @@ def test_route_nhg_update():
369
369
# Test scenario:
370
370
# - create a temporary NHG containing labeled NHs and assert a new NH is added to represent the group
371
371
# - delete a NHG and assert the temporary NHG is promoted and all its NHs are added
372
- def test_labeled_nhg_temporary_promotion ():
372
+ def labeled_nhg_temporary_promotion_test ():
373
373
# Create a next hop group that contains labeled NHs that do not exist
374
374
# in NeighOrch
375
375
self .asic_nhs_count = len (self .asic_db .get_keys (self .ASIC_NHS_STR ))
@@ -398,7 +398,7 @@ def test_labeled_nhg_temporary_promotion():
398
398
# Test scenario:
399
399
# - update route to own its NHG and assert no new NHG is added
400
400
# - remove a NHG and assert the temporary NHG is promoted and added to ASIC DB
401
- def test_back_compatibility ():
401
+ def back_compatibility_test ():
402
402
# Update the route with a RouteOrch's owned NHG
403
403
binary = self .gen_valid_binary ()
404
404
nhg_fvs = self .gen_nhg_fvs (binary )
@@ -421,7 +421,7 @@ def test_back_compatibility():
421
421
# - update the NHG to all invalid NHs again and assert the update is not performed and thus it has the same SAI
422
422
# ID
423
423
# - delete the temporary NHG
424
- def test_invalid_temporary ():
424
+ def invalid_temporary_test ():
425
425
# Create a temporary NHG that contains only NHs that do not exist
426
426
nhg_fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.21,10.0.0.23' ),
427
427
('ifname' , 'Ethernet40,Ethernet44' )])
@@ -474,14 +474,14 @@ def test_invalid_temporary():
474
474
self .nhg_count += 1
475
475
self .asic_db .wait_for_n_keys (self .ASIC_NHG_STR , self .MAX_ECMP_COUNT )
476
476
477
- test_temporary_group_promotion ()
478
- test_group_update ()
479
- test_create_delete_temporary ()
480
- test_update_temporary_group ()
481
- test_route_nhg_update ()
482
- test_labeled_nhg_temporary_promotion ()
483
- test_back_compatibility ()
484
- test_invalid_temporary ()
477
+ temporary_group_promotion_test ()
478
+ group_update_test ()
479
+ create_delete_temporary_test ()
480
+ update_temporary_group_test ()
481
+ route_nhg_update_test ()
482
+ labeled_nhg_temporary_promotion_test ()
483
+ back_compatibility_test ()
484
+ invalid_temporary_test ()
485
485
486
486
# Cleanup
487
487
@@ -865,7 +865,7 @@ def test_nhgorch_labeled_nhs(self, dvs, testlog):
865
865
# - remove the weights from the first NHG and change the labels, leaving one NH unlabeled; assert one NH is
866
866
# deleted
867
867
# - delete the first NHG and perform cleanup
868
- def test_mainline_labeled_nhs ():
868
+ def mainline_labeled_nhs_test ():
869
869
# Add a group containing labeled weighted NHs
870
870
fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.1,10.0.0.3' ),
871
871
('mpls_nh' , 'push1,push3' ),
@@ -954,7 +954,7 @@ def test_mainline_labeled_nhs():
954
954
# - update the NHG by changing the first NH's label and assert a new NH is created
955
955
# - remove the route and assert that only one (now unreferenced) NH is removed
956
956
# - remove the NHG and perform cleanup
957
- def test_routeorch_nhgorch_interop ():
957
+ def routeorch_nhgorch_interop_test ():
958
958
# Create a route with labeled NHs
959
959
fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.1,10.0.0.3' ),
960
960
('mpls_nh' , 'push1,push3' ),
@@ -1007,13 +1007,13 @@ def test_routeorch_nhgorch_interop():
1007
1007
1008
1008
self .init_test (dvs , 2 )
1009
1009
1010
- test_mainline_labeled_nhs ()
1011
- test_routeorch_nhgorch_interop ()
1010
+ mainline_labeled_nhs_test ()
1011
+ routeorch_nhgorch_interop_test ()
1012
1012
1013
1013
def test_nhgorch_excp_group_cases (self , dvs , testlog ):
1014
1014
# Test scenario:
1015
1015
# - remove a NHG that does not exist and assert the number of NHGs in ASIC DB remains the same
1016
- def test_remove_inexistent_nhg ():
1016
+ def remove_inexistent_nhg_test ():
1017
1017
# Remove a group that does not exist
1018
1018
self .nhg_ps ._del ("group1" )
1019
1019
time .sleep (1 )
@@ -1022,7 +1022,7 @@ def test_remove_inexistent_nhg():
1022
1022
# Test scenario:
1023
1023
# - create a NHG with a member which does not exist and assert no NHG is created
1024
1024
# - update the NHG to contain all valid members and assert the NHG is created and it has 2 members
1025
- def test_nhg_members_validation ():
1025
+ def nhg_members_validation_test ():
1026
1026
# Create a next hop group with a member that does not exist - should fail
1027
1027
fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.1,10.0.0.3,10.0.0.63' ),
1028
1028
("ifname" , "Ethernet0,Ethernet4,Ethernet124" )])
@@ -1048,7 +1048,7 @@ def test_nhg_members_validation():
1048
1048
# - create a new NHG and assert it and its members are being created
1049
1049
# - update the route to point to the new NHG and assert the first NHG is now deleted as it's not referenced
1050
1050
# anymore
1051
- def test_remove_referenced_nhg ():
1051
+ def remove_referenced_nhg_test ():
1052
1052
# Add a route referencing the new group
1053
1053
fvs = swsscommon .FieldValuePairs ([('nexthop_group' , 'group1' )])
1054
1054
self .rt_ps .set ('2.2.2.0/24' , fvs )
@@ -1081,7 +1081,7 @@ def test_remove_referenced_nhg():
1081
1081
# - update the route created in `test_remove_referenced_nhg` to own the NHG with the same details as the
1082
1082
# previous one and assert a new NHG and 2 new NHGMs are added
1083
1083
# - update the route to point back to the original NHG and assert the routeOrch's owned NHG is deleted
1084
- def test_routeorch_nhgorch_interop ():
1084
+ def routeorch_nhgorch_interop_test ():
1085
1085
rt_id = self .get_route_id ('2.2.2.0/24' )
1086
1086
assert rt_id is not None
1087
1087
@@ -1113,7 +1113,7 @@ def test_routeorch_nhgorch_interop():
1113
1113
# Test scenario:
1114
1114
# - create a new NHG with the same details as the previous NHG and assert a new NHG and 2 new NHGMs are created
1115
1115
# - update the route to point to the new NHG and assert its SAI NHG ID changes
1116
- def test_identical_nhgs ():
1116
+ def identical_nhgs_test ():
1117
1117
rt_id = self .get_route_id ('2.2.2.0/24' )
1118
1118
assert rt_id is not None
1119
1119
@@ -1135,7 +1135,7 @@ def test_identical_nhgs():
1135
1135
1136
1136
# Test scenario:
1137
1137
# - create a route referencing a NHG that does not exist and assert it is not created
1138
- def test_create_route_inexistent_nhg ():
1138
+ def create_route_inexistent_nhg_test ():
1139
1139
# Add a route with a NHG that does not exist
1140
1140
fvs = swsscommon .FieldValuePairs ([('nexthop_group' , 'group3' )])
1141
1141
self .rt_ps .set ('2.2.3.0/24' , fvs )
@@ -1147,12 +1147,12 @@ def test_create_route_inexistent_nhg():
1147
1147
1148
1148
self .init_test (dvs , 3 )
1149
1149
1150
- test_remove_inexistent_nhg ()
1151
- test_nhg_members_validation ()
1152
- test_remove_referenced_nhg ()
1153
- test_routeorch_nhgorch_interop ()
1154
- test_identical_nhgs ()
1155
- test_create_route_inexistent_nhg ()
1150
+ remove_inexistent_nhg_test ()
1151
+ nhg_members_validation_test ()
1152
+ remove_referenced_nhg_test ()
1153
+ routeorch_nhgorch_interop_test ()
1154
+ identical_nhgs_test ()
1155
+ create_route_inexistent_nhg_test ()
1156
1156
1157
1157
# Cleanup
1158
1158
@@ -1169,7 +1169,7 @@ def test_create_route_inexistent_nhg():
1169
1169
def test_nhgorch_nh_group (self , dvs , testlog ):
1170
1170
# Test scenario:
1171
1171
# - create NHG 'group1' and assert it is being added to ASIC DB along with its members
1172
- def test_create_nhg ():
1172
+ def create_nhg_test ():
1173
1173
# create next hop group in APPL DB
1174
1174
fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.1,10.0.0.3,10.0.0.5' ),
1175
1175
("ifname" , "Ethernet0,Ethernet4,Ethernet8" )])
@@ -1186,7 +1186,7 @@ def test_create_nhg():
1186
1186
# Test scenario:
1187
1187
# - create a route pointing to `group1` and assert it is being added to ASIC DB and pointing to its SAI ID
1188
1188
# - delete the route and assert it is being removed
1189
- def test_create_route_nhg ():
1189
+ def create_route_nhg_test ():
1190
1190
# create route in APPL DB
1191
1191
fvs = swsscommon .FieldValuePairs ([("nexthop_group" , "group1" )])
1192
1192
self .rt_ps .set ("2.2.2.0/24" , fvs )
@@ -1209,7 +1209,7 @@ def test_create_route_nhg():
1209
1209
# - bring the links down one by one and assert the group1's members are subsequently removed and the group
1210
1210
# still exists
1211
1211
# - bring the liks up one by one and assert the group1's members are subsequently added back
1212
- def test_link_flap ():
1212
+ def link_flap_test ():
1213
1213
# bring links down one-by-one
1214
1214
for i in [0 , 1 , 2 ]:
1215
1215
self .flap_intf (i , 'down' )
@@ -1231,7 +1231,7 @@ def test_link_flap():
1231
1231
# assert it'll only have a member added in ASIC DB
1232
1232
# - bring the link back up and assert the missing 2 members of `group1` and `group2` are added
1233
1233
# - remove `group2` and assert it and its members are removed
1234
- def test_validate_invalidate_group_member ():
1234
+ def validate_invalidate_group_member_test ():
1235
1235
# Bring an interface down
1236
1236
self .flap_intf (1 , 'down' )
1237
1237
@@ -1275,7 +1275,7 @@ def test_validate_invalidate_group_member():
1275
1275
# - update `group1` to contain the invalid NH and assert it remains only with the unremoved members
1276
1276
# - configure the invalid NH's interface and assert `group2` gets created and `group1`'s NH is added
1277
1277
# - delete `group` and assert it is being removed
1278
- def test_inexistent_group_member ():
1278
+ def inexistent_group_member_test ():
1279
1279
# Create group2 with a NH that does not exist
1280
1280
fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.3,10.0.0.63' ),
1281
1281
("ifname" , "Ethernet4,Ethernet124" )])
@@ -1315,7 +1315,7 @@ def test_inexistent_group_member():
1315
1315
# - update `group1` to have 4 members and assert they are all added
1316
1316
# - update `group1` to have only 1 member and assert the other 3 are removed
1317
1317
# - update `group1` to have 2 members and assert a new one is added
1318
- def test_update_nhgm_count ():
1318
+ def update_nhgm_count_test ():
1319
1319
# Update the NHG, adding two new members
1320
1320
fvs = swsscommon .FieldValuePairs ([('nexthop' , '10.0.0.1,10.0.0.3,10.0.0.5,10.0.0.7' ),
1321
1321
("ifname" , "Ethernet0,Ethernet4,Ethernet8,Ethernet12" )])
@@ -1337,12 +1337,12 @@ def test_update_nhgm_count():
1337
1337
1338
1338
self .init_test (dvs , 4 )
1339
1339
1340
- test_create_nhg ()
1341
- test_create_route_nhg ()
1342
- test_link_flap ()
1343
- test_validate_invalidate_group_member ()
1344
- test_inexistent_group_member ()
1345
- test_update_nhgm_count ()
1340
+ create_nhg_test ()
1341
+ create_route_nhg_test ()
1342
+ link_flap_test ()
1343
+ validate_invalidate_group_member_test ()
1344
+ inexistent_group_member_test ()
1345
+ update_nhgm_count_test ()
1346
1346
1347
1347
# Cleanup
1348
1348
0 commit comments