Skip to content

Commit 4f39f9f

Browse files
authored
[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
1 parent 1a75870 commit 4f39f9f

File tree

3 files changed

+2934
-177
lines changed

3 files changed

+2934
-177
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"EMPTYING_A_CONFIGDB_TABLE__FAILURE": {
3+
"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.",
4+
"current_config": {
5+
"ACL_TABLE": {
6+
"EVERFLOW": {
7+
"policy_desc": "EVERFLOW",
8+
"ports": [
9+
"Ethernet0"
10+
],
11+
"stage": "ingress",
12+
"type": "MIRROR"
13+
}
14+
},
15+
"PORT": {
16+
"Ethernet0": {
17+
"alias": "Eth1",
18+
"lanes": "65, 66, 67, 68",
19+
"description": "Ethernet0 100G link",
20+
"speed": "100000"
21+
}
22+
}
23+
},
24+
"patch": [
25+
{"op": "remove", "path": "/ACL_TABLE/EVERFLOW"}
26+
],
27+
"expected_error_substrings": [
28+
"There is no possible sorting"
29+
]
30+
},
31+
"ADDING_AN_EMPTY_CONFIGDB_TABLE__FAILURE": {
32+
"desc": "Adding an empty configdb table fail because empty tables are not allowed in configdb.",
33+
"current_config": {},
34+
"patch": [
35+
{"op": "add", "path": "/VLAN", "value": {}}
36+
],
37+
"expected_error_substrings": [
38+
"There is no possible sorting"
39+
]
40+
},
41+
"EMPTYING_MULTIPLE_CONFIGDB_TABLE__FAILURE": {
42+
"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.",
43+
"current_config": {
44+
"ACL_TABLE": {
45+
"EVERFLOW": {
46+
"policy_desc": "EVERFLOW",
47+
"ports": [
48+
"Ethernet0"
49+
],
50+
"stage": "ingress",
51+
"type": "MIRROR"
52+
}
53+
},
54+
"PORT": {
55+
"Ethernet0": {
56+
"alias": "Eth1",
57+
"lanes": "65, 66, 67, 68",
58+
"description": "Ethernet0 100G link",
59+
"speed": "100000"
60+
}
61+
}
62+
},
63+
"patch": [
64+
{"op": "remove", "path": "/ACL_TABLE/EVERFLOW"},
65+
{"op": "remove", "path": "/PORT/Ethernet0"}
66+
],
67+
"expected_error_substrings": [
68+
"There is no possible sorting"
69+
]
70+
}
71+
}

0 commit comments

Comments
 (0)