-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[202012][multi-asic][sonic-config-engine]: Get PORT table from namespace config db #10475
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
305b4ec
[multi-asic][sonic-config-engine]: Get PORT table from namespace conf…
SuvarnaMeenakshi c3a1233
Remove tpid field in the expected output.
SuvarnaMeenakshi b769ac1
Merge remote-tracking branch 'origin/202012' into HEAD
SuvarnaMeenakshi d060e79
Revert "[ci] Set default ACR in UpgrateVersion/PR/official pipeline. …
SuvarnaMeenakshi 7c59781
Merge branch '202012' into cfggen
wenyiz2021 0ba22c9
Merge branch '202012' into cfggen
qiluo-msft 9d975ff
Merge branch '202012' into cfggen
qiluo-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Empty file.
98 changes: 98 additions & 0 deletions
98
src/sonic-config-engine/tests/mock_tables/asic0/config_db.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,98 @@ | ||
{ | ||
"PORT|Ethernet0": { | ||
"index": "0", | ||
"lanes": "33,34,35,36", | ||
"description": "01T2:Ethernet1:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Ethernet1/1", | ||
"admin_status": "up", | ||
"role": "Ext", | ||
"speed": "40000", | ||
"asic_port_name": "Eth0-ASIC0" | ||
}, | ||
"PORT|Ethernet4": { | ||
"index": "1", | ||
"lanes": "29,30,31,32", | ||
"description": "01T2:Ethernet2:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Ethernet1/2", | ||
"admin_status": "up", | ||
"role": "Ext", | ||
"speed": "40000", | ||
"asic_port_name": "Eth1-ASIC0" | ||
}, | ||
"PORT|Ethernet8": { | ||
"index": "2", | ||
"lanes": "41,42,43,44", | ||
"description": "Ethernet1/3:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Ethernet1/3", | ||
"admin_status": "up", | ||
"role": "Ext", | ||
"speed": "40000", | ||
"asic_port_name": "Eth2-ASIC0" | ||
}, | ||
"PORT|Ethernet12": { | ||
"index": "3", | ||
"lanes": "37,38,39,40", | ||
"description": "Ethernet1/4:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Ethernet1/4", | ||
"admin_status": "up", | ||
"role": "Ext", | ||
"speed": "40000", | ||
"asic_port_name": "Eth3-ASIC0" | ||
}, | ||
"PORT|Ethernet-BP0": { | ||
"index": "0", | ||
"lanes": "13,14,15,16", | ||
"description": "ASIC2:Eth0-ASIC2:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Eth4-ASIC0", | ||
"admin_status": "up", | ||
"role": "Int", | ||
"speed": "40000", | ||
"asic_port_name": "Eth4-ASIC0" | ||
}, | ||
"PORT|Ethernet-BP4": { | ||
"index": "1", | ||
"lanes": "17,18,19,20", | ||
"description": "ASIC2:Eth1-ASIC2:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Eth5-ASIC0", | ||
"admin_status": "up", | ||
"role": "Int", | ||
"speed": "40000", | ||
"asic_port_name": "Eth5-ASIC0" | ||
}, | ||
"PORT|Ethernet-BP8": { | ||
"index": "2", | ||
"lanes": "21,22,23,24", | ||
"description": "ASIC3:Eth0-ASIC3:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Eth6-ASIC0", | ||
"admin_status": "up", | ||
"role": "Int", | ||
"speed": "40000", | ||
"asic_port_name": "Eth6-ASIC0" | ||
}, | ||
"PORT|Ethernet-BP12": { | ||
"index": "3", | ||
"lanes": "25,26,27,28", | ||
"description": "ASIC3:Eth1-ASIC3:config_db", | ||
"pfc_asym": "off", | ||
"mtu": "9100", | ||
"alias": "Eth7-ASIC0", | ||
"admin_status": "up", | ||
"role": "Int", | ||
"speed": "40000", | ||
"asic_port_name": "Eth7-ASIC0" | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/sonic-config-engine/tests/mock_tables/asic0/database_config.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,57 @@ | ||
{ | ||
"INSTANCES": { | ||
"redis": { | ||
"hostname" : "127.0.0.1", | ||
"port" : 6379, | ||
"unix_socket_path" : "/var/run/redis/redis.sock" | ||
} | ||
}, | ||
"DATABASES" : { | ||
"APPL_DB" : { | ||
"id" : 0, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"ASIC_DB" : { | ||
"id" : 1, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"COUNTERS_DB" : { | ||
"id" : 2, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"LOGLEVEL_DB" : { | ||
"id" : 3, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"CONFIG_DB" : { | ||
"id" : 4, | ||
"separator": "|", | ||
"instance" : "redis" | ||
}, | ||
"PFC_WD_DB" : { | ||
"id" : 5, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"FLEX_COUNTER_DB" : { | ||
"id" : 5, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"STATE_DB" : { | ||
"id" : 6, | ||
"separator": "|", | ||
"instance" : "redis" | ||
}, | ||
"SNMP_OVERLAY_DB" : { | ||
"id" : 7, | ||
"separator": "|", | ||
"instance" : "redis" | ||
} | ||
}, | ||
"VERSION" : "1.1" | ||
} |
2 changes: 2 additions & 0 deletions
2
src/sonic-config-engine/tests/mock_tables/asic1/config_db.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,2 @@ | ||
{ | ||
} |
57 changes: 57 additions & 0 deletions
57
src/sonic-config-engine/tests/mock_tables/asic1/database_config.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,57 @@ | ||
{ | ||
"INSTANCES": { | ||
"redis": { | ||
"hostname" : "127.0.0.1", | ||
"port" : 6379, | ||
"unix_socket_path" : "/var/run/redis/redis.sock" | ||
} | ||
}, | ||
"DATABASES" : { | ||
"APPL_DB" : { | ||
"id" : 0, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"ASIC_DB" : { | ||
"id" : 1, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"COUNTERS_DB" : { | ||
"id" : 2, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"LOGLEVEL_DB" : { | ||
"id" : 3, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"CONFIG_DB" : { | ||
"id" : 4, | ||
"separator": "|", | ||
"instance" : "redis" | ||
}, | ||
"PFC_WD_DB" : { | ||
"id" : 5, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"FLEX_COUNTER_DB" : { | ||
"id" : 5, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"STATE_DB" : { | ||
"id" : 6, | ||
"separator": "|", | ||
"instance" : "redis" | ||
}, | ||
"SNMP_OVERLAY_DB" : { | ||
"id" : 7, | ||
"separator": "|", | ||
"instance" : "redis" | ||
} | ||
}, | ||
"VERSION" : "1.1" | ||
} |
2 changes: 2 additions & 0 deletions
2
src/sonic-config-engine/tests/mock_tables/asic2/config_db.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,2 @@ | ||
{ | ||
} |
57 changes: 57 additions & 0 deletions
57
src/sonic-config-engine/tests/mock_tables/asic2/database_config.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,57 @@ | ||
{ | ||
"INSTANCES": { | ||
"redis": { | ||
"hostname" : "127.0.0.1", | ||
"port" : 6379, | ||
"unix_socket_path" : "/var/run/redis/redis.sock" | ||
} | ||
}, | ||
"DATABASES" : { | ||
"APPL_DB" : { | ||
"id" : 0, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"ASIC_DB" : { | ||
"id" : 1, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"COUNTERS_DB" : { | ||
"id" : 2, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"LOGLEVEL_DB" : { | ||
"id" : 3, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"CONFIG_DB" : { | ||
"id" : 4, | ||
"separator": "|", | ||
"instance" : "redis" | ||
}, | ||
"PFC_WD_DB" : { | ||
"id" : 5, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"FLEX_COUNTER_DB" : { | ||
"id" : 5, | ||
"separator": ":", | ||
"instance" : "redis" | ||
}, | ||
"STATE_DB" : { | ||
"id" : 6, | ||
"separator": "|", | ||
"instance" : "redis" | ||
}, | ||
"SNMP_OVERLAY_DB" : { | ||
"id" : 7, | ||
"separator": "|", | ||
"instance" : "redis" | ||
} | ||
}, | ||
"VERSION" : "1.1" | ||
} |
2 changes: 2 additions & 0 deletions
2
src/sonic-config-engine/tests/mock_tables/asic3/config_db.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,2 @@ | ||
{ | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the type of exception you are expecting? The general exception type will hide bugs and should be limited. #Pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was added to handle exception if thrown by load_sonic_global_db_config().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like load_sonic_global_db_config() calls SonicDBConfig::initializeGlobalConfig() which already handled exceptions, and it should be good enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a PR : #10581 to remove this, I am working on unit-test failure, will merge that PR in master branch first and then take it in to 202012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qiluo-msft #10581 is merged in master branch to fix this comment. Can we merge this PR to 202012 branch and cherry-pick the other PR to 202012.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#10960 - PR raised to fix this comment.