forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GCU] Moving PatchSorter unit-test to json file to make it easier to …
…read/maintain (sonic-net#1977) #### What I did Moved PatchSorter unit-test to json file to make it easier to read/maintain In the future this test json file can be used for adding nightly tests. While testing I had to set `skip_exact_change_list_match=True` because different runs of the same input produce correct but different changes. It is better to always generate the same steps for easier debugging. Created issue: sonic-net#1976 #### How I did it Copied to Json file the following: - current_config i.e. current running config - patch - expected change list #### How to verify it unit-tests
- Loading branch information
Showing
3 changed files
with
2,934 additions
and
177 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
tests/generic_config_updater/files/patch_sorter_test_failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"EMPTYING_A_CONFIGDB_TABLE__FAILURE": { | ||
"desc": "Emptying a configdb table fails because empty tables are not allowed in configdb. User should remove whole table instead e.g. remove /ACL_TABLE in this case.", | ||
"current_config": { | ||
"ACL_TABLE": { | ||
"EVERFLOW": { | ||
"policy_desc": "EVERFLOW", | ||
"ports": [ | ||
"Ethernet0" | ||
], | ||
"stage": "ingress", | ||
"type": "MIRROR" | ||
} | ||
}, | ||
"PORT": { | ||
"Ethernet0": { | ||
"alias": "Eth1", | ||
"lanes": "65, 66, 67, 68", | ||
"description": "Ethernet0 100G link", | ||
"speed": "100000" | ||
} | ||
} | ||
}, | ||
"patch": [ | ||
{"op": "remove", "path": "/ACL_TABLE/EVERFLOW"} | ||
], | ||
"expected_error_substrings": [ | ||
"There is no possible sorting" | ||
] | ||
}, | ||
"ADDING_AN_EMPTY_CONFIGDB_TABLE__FAILURE": { | ||
"desc": "Adding an empty configdb table fail because empty tables are not allowed in configdb.", | ||
"current_config": {}, | ||
"patch": [ | ||
{"op": "add", "path": "/VLAN", "value": {}} | ||
], | ||
"expected_error_substrings": [ | ||
"There is no possible sorting" | ||
] | ||
}, | ||
"EMPTYING_MULTIPLE_CONFIGDB_TABLE__FAILURE": { | ||
"desc": "Emptying multiple configdb table fails because empty tables are not allowed in configdb. User should remove whole tables instead e.g. remove /PORT and /ACL_TABLE in this case.", | ||
"current_config": { | ||
"ACL_TABLE": { | ||
"EVERFLOW": { | ||
"policy_desc": "EVERFLOW", | ||
"ports": [ | ||
"Ethernet0" | ||
], | ||
"stage": "ingress", | ||
"type": "MIRROR" | ||
} | ||
}, | ||
"PORT": { | ||
"Ethernet0": { | ||
"alias": "Eth1", | ||
"lanes": "65, 66, 67, 68", | ||
"description": "Ethernet0 100G link", | ||
"speed": "100000" | ||
} | ||
} | ||
}, | ||
"patch": [ | ||
{"op": "remove", "path": "/ACL_TABLE/EVERFLOW"}, | ||
{"op": "remove", "path": "/PORT/Ethernet0"} | ||
], | ||
"expected_error_substrings": [ | ||
"There is no possible sorting" | ||
] | ||
} | ||
} |
Oops, something went wrong.