-
Notifications
You must be signed in to change notification settings - Fork 661
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
Added config commands for CBF #1799
Added config commands for CBF #1799
Conversation
What I did: Added reload and clear commands for CBF. How I did it: Added the commands in a similar manner to the existing QOS support. How to verify it: Run the commands on a CBF capable platform. Files changes: config/main.py Signed-off-by: Cosmin Jinga <v-cjinga@microsoft.com>
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@Cosmin-Jinga-MS Can you also add unit test for your code. You can use the following as an example: In case you are not familiar with creating a test environment, here's the link: |
Requested UT added. |
…e other QoS map tables
@@ -0,0 +1,12 @@ | |||
{ |
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.
There's no variables here to use a template. In any case the file here should be the one that will be used when generating the config using "sonic_cfggen" command. How will these entries be created in production switch. Is there going to be a new template or are you going to use the existing qos templates.
eg:
https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/qos_config.j2
https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/buffers_config.j2
There should be a PR for those changes if not already there. Copy the same template (that's used in prod switches) here for testing.
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.
Yes there is a separate PR for the default CBF template config. It's been updated as well with the new config now found in the UTs too.
sonic-net/sonic-buildimage#8689
@@ -0,0 +1,8 @@ | |||
build_version: 'master.487-a98cf221' |
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.
may be we can reuse the exsiting one.. CBF, QoS are close related anyway.
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.
reused the qos one
print("TEARDOWN") | ||
os.environ['UTILITIES_UNIT_TESTING'] = "0" | ||
|
||
|
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.
If this feature will be used in WAN there's a high chance it will be multi ASIC platform. Please add test case for multi ASIC as well. You already added the code to generate, just need to add test cases. It can be the same pattern as QoS tests.
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.
added the multi asic UT
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.
left comments.
Pushed new commit addressing the latest review comments. |
@@ -608,6 +608,27 @@ def _change_hostname(hostname): | |||
clicommon.run_command(r'sed -i "/\s{}$/d" /etc/hosts'.format(current_hostname), display_cmd=True) | |||
clicommon.run_command('echo "127.0.0.1 {}" >> /etc/hosts'.format(hostname), display_cmd=True) | |||
|
|||
def _clear_cbf(): | |||
CBF_TABLE_NAMES = [ | |||
'DSCP_TO_FC_MAP', |
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.
elsewhere it's DSCP_TO_TC_MAP. Please update.
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.
The other updates were incorrect. CBF has to have its own DSCP mapping, I've reverted the names to DSCP_TO_FC_MAP in the other occurrences too.
d6a9fe1
to
c39c228
Compare
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 good.
[config]
###What I did:
Added reload and clear commands for CBF.
###How I did it:
Added the commands in a similar manner to the existing QOS support.
###How to verify it:
Run the commands on a CBF capable platform.
###File changes: config/main.py