-
Notifications
You must be signed in to change notification settings - Fork 664
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
[201911-Mellanox] SKU creator Tool (#1163) #1250
[201911-Mellanox] SKU creator Tool (#1163) #1250
Conversation
I added a new script file sonic_sku_create.py to generate a new HWSKU based on XML file or Minigraph. But, focus is on creating HWSKU based on XML file and not on the minigraph and l2 mode. I also added a unit test pyTest script sku_create_test.py in sonic-utilities-test folder to test the script in Unit Testing mode. Motivation: To create SKU for Mellanox platforms based on XML file with Port related inputs and also through Minigraph file. This tool also allows to split a port or unsplit ports based on configuration which modifies the port related information in port_config.ini and config_db.json usage: sonic_sku_create.py [-h] [-v] (-f FILE | -m [MINIGRAPH_FILE] | -j JSON_FILE | -pp PORT_SPLIT PORT_SPLIT) [-b BASE] [-r] [-k HWSKU] [-p] [-vv] Create a new SKU optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -f FILE, --file FILE SKU definition from xml file. -f OR -m or -j must be provided when creating a new SKU -m [MINIGRAPH_FILE], --minigraph_file [MINIGRAPH_FILE] SKU definition from minigraph file. -f OR -m or -j must be provided when creating a new SKU -j JSON_FILE, --json_file JSON_FILE SKU definition from config_db.json file. -f OR -m OR -j must be provided when creating a new SKU -pp PORT_SPLIT PORT_SPLIT, --port_split PORT_SPLIT PORT_SPLIT port name and split -b BASE, --base BASE SKU base definition -r, --remove Remove SKU folder -k HWSKU, --hwsku HWSKU SKU name to be used when creating a new SKU or for L2 configuration mode -p, --print Print port_config.ini without creating a new SKU -vv, --verbose Verbose output
@madhanmellanox: 201911 PR test is now fixed. The build failure appears to be real. Is this because you need to delete the directory first, like you did in master? |
@jleveque I have handled deletion of output directory before running the test script in this PR as like master. The build failure points out it is not able to find sonic_sku_create.py, I am not sure why? 18:52:13 _________________________ TestSkuCreate.test_no_param __________________________ |
I believe you need to change the line
to
Because scripts_path is added to PATH in the |
@jleveque even after mentioning just the script name, I am still getting file not found error. 14:54:17 _________________________ TestSkuCreate.test_no_param __________________________ |
@madhanmellanox: I have no other suggestions. You will need to reproduce locally. |
@jleveque if I run my test individually on my server, it runs fine. But, if I run pytest without parameters, ie, running all the test cases, other test cases like intfutil.py, portstat_test.py, sfp_test.py etc fails. Since my test case is passing in my build server when I try it manually, I am not sure why in the PR build environment it is failing with error: "sonic_sku_create.py - file not found". |
retest this please |
retest this please |
2 similar comments
retest this please |
retest this please |
Retest this please |
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.
ccb5245 (HEAD -> 201911, origin/201911) [fast-reboot] Fix fast-reboot when NDP entries are present (sonic-net#1295) d09667b Multi-ASIC support for show ip(v6) route (201911 branch) (sonic-net#1283) 28399bf [201911-Mellanox] SKU creator Tool (sonic-net#1163) (sonic-net#1250) Signed-off-by: Abhishek Dosi <[email protected]>
ce8b1af9d2200c570c102a38e04cbd9659470585 (HEAD -> 201911, origin/201911) const initializer_list is not a constant expression (sonic-net#1250) acdb03324fc268f5330d2632a02d0856f35fb880 [201911] Add lgtm.yml (sonic-net#1901) Signed-off-by: Abhishek Dosi <[email protected]>
- What I did
I added a new script file sonic_sku_create.py to generate a new HWSKU based on XML file or Minigraph. But, focus is on creating HWSKU based on XML file and not on the minigraph and l2 mode. I also added a unit test pyTest script sku_create_test.py in sonic-utilities-test folder to test the script in Unit Testing mode.
Motivation: To create SKU for Mellanox platforms based on XML file with Port related inputs and also through Minigraph file.
This tool also allows to split a port or unsplit ports based on configuration which modifies the port related information in port_config.ini and config_db.json
usage: sonic_sku_create.py [-h] [-v]
(-f FILE | -m [MINIGRAPH_FILE] | -j JSON_FILE | -pp PORT_SPLIT PORT_SPLIT)
[-b BASE] [-r] [-k HWSKU] [-p] [-vv]
Create a new SKU
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f FILE, --file FILE SKU definition from xml file. -f OR -m or -j must be provided when creating a new SKU
-m [MINIGRAPH_FILE], --minigraph_file [MINIGRAPH_FILE]
SKU definition from minigraph file. -f OR -m or -j must be provided when creating a new SKU
-j JSON_FILE, --json_file JSON_FILE
SKU definition from config_db.json file. -f OR -m OR -j must be provided when creating a new SKU
-pp PORT_SPLIT PORT_SPLIT, --port_split PORT_SPLIT PORT_SPLIT
port name and split
-b BASE, --base BASE SKU base definition
-r, --remove Remove SKU folder
-k HWSKU, --hwsku HWSKU
SKU name to be used when creating a new SKU or for L2 configuration mode
-p, --print Print port_config.ini without creating a new SKU
-vv, --verbose Verbose output
- How I did it
I did it by adding these files which are required for new SKU generation in the forthcoming releases.
- How to verify it
I verified all the options of sonic_sku_create.py file and tested them thoroughly as well as created a test case in sku_create_test.py file to test the functionality of sonic_sku_create.py in Unit Test mode.
- Previous command output (if the output of a command-line utility has changed)
None
- New command output (if the output of a command-line utility has changed)