forked from sonic-net/sonic-utilities
-
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.
Update db_migrator to support
PORT_QOS_MAP|global
(sonic-net#2205)
Signed-off-by: bingwang <[email protected]> What I did This PR is to update the db_migrator to support generation of PORT_QOS_MAP|global. After PR sonic-net/sonic-buildimage#10565, there will be two DSCP_TO_TC_MAP DSCP_TO_TC_MAP|AZURE is the default map, which is used at port level and switch level DSCP_TO_TC_MAP|AZURE_TUNNEL is used to remap the priority of tunnel traffic in dualtor deployment To address the issue, an entry PORT_QOS_MAP|global will be added into config_db "PORT_QOS_MAP": { "global": { "dscp_to_tc_map": "AZURE" } } To handle the upgrade from older image, db_migrator is updated to generate the entry. There is no way to check if PORT_QOS_MAP|global is supported, so the migration is ran on all platforms. There is check in sonic-swss to check the switch capability code, so it will not cause issue. How I did it Update db_migrator to add a common migration step. How to verify it Verified by vstest
- Loading branch information
1 parent
e523615
commit 987dd91
Showing
4 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
tests/db_migrator_input/config_db/qos_map_table_global_expected.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,12 @@ | ||
{ | ||
"VERSIONS|DATABASE": { | ||
"VERSION": "version_3_0_6" | ||
}, | ||
"DSCP_TO_TC_MAP|AZURE": { | ||
"0": "0", | ||
"1": "1" | ||
}, | ||
"PORT_QOS_MAP|global": { | ||
"dscp_to_tc_map": "AZURE" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/db_migrator_input/config_db/qos_map_table_global_input.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,10 @@ | ||
{ | ||
"VERSIONS|DATABASE": { | ||
"VERSION": "version_3_0_5" | ||
}, | ||
"DSCP_TO_TC_MAP|AZURE": { | ||
"0": "0", | ||
"1": "1" | ||
} | ||
} | ||
|
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