Skip to content
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

[cfg engine] Add support of platform.json parsing to portconfig.py file #7

Merged

Conversation

samaity
Copy link
Collaborator

@samaity samaity commented Oct 30, 2019

Signed-off-by: Sangita Maity [email protected]

- What I did
Add support of platform.json parsing to portconfig.py file which is being used by sonic-cfggen and minigraph.py file under src/sonic-config-engine folder to get port config via get_port_config function.

- How I did it

  1. portconfig.py file will first check whether the platform.json file is there or not. if not then whether port_config.ini file is there or not. Modified get_port_config_file_name for this purpose.
  2. Added a separate function i.e. parse_platform_json_file in portconfig.py file.

- How to verify it

rebuilt "sonic_config_engine-1.0" wheel package with all the test cases.All the below-mentioned test cases passed.

# Check whether all interfaces present or not as per platform.json
def test_platform_json_interfaces_keys(self):
       
# Check specific Interface with it's proper configuration as per platform.json
def test_platform_json_specific_ethernet_interfaces(self):

# Check all Interface with it's proper configuration as per platform.json
def test_platform_json_all_ethernet_interfaces(self):

log file

samaity@50c03d616603:/sonic$ BLDENV=stretch make -f slave.mk target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl
SONiC Build System

Build Configuration
"CONFIGURED_PLATFORM"             : "vs"
"CONFIGURED_ARCH"                 : "amd64"
"SONIC_CONFIG_PRINT_DEPENDENCIES" : ""
"SONIC_BUILD_JOBS"                : "1"
"SONIC_CONFIG_MAKE_JOBS"          : "24"
"SONIC_USE_DOCKER_BUILDKIT"       : ""
"USERNAME"                        : "admin"
"PASSWORD"                        : "admin123"
"ENABLE_DHCP_GRAPH_SERVICE"       : ""
"SHUTDOWN_BGP_ON_START"           : ""
"ENABLE_PFCWD_ON_START"           : ""
"INSTALL_DEBUG_TOOLS"             : ""
"ROUTING_STACK"                   : "frr"
"FRR_USER_UID"                    : "300"
"FRR_USER_GID"                    : "300"
"ENABLE_SYNCD_RPC"                : ""
"ENABLE_ORGANIZATION_EXTENSIONS"  : "y"
"HTTP_PROXY"                      : ""
"HTTPS_PROXY"                     : ""
"ENABLE_SYSTEM_TELEMETRY"         : "y"
"SONIC_DEBUGGING_ON"              : ""
"SONIC_PROFILING_ON"              : ""
"KERNEL_PROCURE_METHOD"           : "build"
"BUILD_TIMESTAMP"                 : ""
"BLDENV"                          : "stretch"
"VS_PREPARE_MEM"                  : "yes"
"ENABLE_SFLOW"                    : "y"

samaity@server09:~/REPO_FACTORY/GIT_REPO/DPB/sonic-buildimage$ ls -la     target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl
-rw-r--r-- 1 samaity samaity 44514 Dec  2 19:05 target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl

Copy link
Owner

@zhenggen-xu zhenggen-xu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have the test results for all vs tests? We should make the platform.json available to the vs docker, and see if the logic works for all existing test cases. We also should add additional test cases for the new logic.

src/sonic-config-engine/portconfig.py Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Outdated Show resolved Hide resolved
src/sonic-config-engine/portconfig.py Show resolved Hide resolved
@samaity
Copy link
Collaborator Author

samaity commented Dec 2, 2019

Do you have the test results for all vs tests? We should make the platform.json available to the vs docker, and see if the logic works for all existing test cases. We also should add additional test cases for the new logic.

added additional test cases in sonic-cfg-engine test folder. These tests will be done during built.

Signed-off-by: Sangita Maity <[email protected]>
@samaity samaity requested a review from vasant17 December 5, 2019 01:42
Signed-off-by: Sangita Maity <[email protected]>
@vasant17
Copy link
Collaborator

vasant17 commented Dec 5, 2019

👍

@zhenggen-xu zhenggen-xu merged commit a6082ca into zhenggen-xu:sonic-cfg-mgmt Dec 5, 2019
@samaity samaity deleted the port_config_file_change branch December 15, 2019 13:39
zhenggen-xu pushed a commit that referenced this pull request Jan 10, 2020
…le (#7)

* [buildImage] Add support of platform.json parsing to portconfig.py file

Signed-off-by: Sangita Maity <[email protected]>

* [sonic-cfggen] Add a unit-test to test platform capability file

Signed-off-by: Sangita Maity <[email protected]>

* Minor Update

Signed-off-by: Sangita Maity <[email protected]>

* Created One Logic for symmetric and asymmetric modes

Signed-off-by: Sangita Maity <[email protected]>

* Passing tuple from Match_list

Signed-off-by: Sangita Maity <[email protected]>
zhenggen-xu pushed a commit that referenced this pull request Dec 15, 2020
This update brings in the following commits.

86c1108 Enable arm architecture to build in addition to amd64 (#37)
4acb2c3 fix bugs and enhance Transformer (#35)
49e5a22 ygot related enhancements and fixes (#34)
51224de Fix ietf yang search path for cvl schema builds (#32)
3c6cdb3 CVL Changes #8: 'must' and 'when' expression evaluation (#31)
dabf231 CVL Changes #7: 'leafref' evaluation (#28)
6f9535f CVL Changes #6: Customized Xpath Engine integration (#27)
5e2466b DB-Layer fixes/enhancements (#26)
9a27302 CVL Changes #4: Implementation of new CVL APIs (#22)
dbf1093 Translib support for authorization, yang versioning and Delete flag (#21)
80f369e CVL Changes #5: YParser enhancement (#23)
904ce18 CVL Changes #3: Multi-db instance support (#20)
9d24a34 CVL Changes #2:  YValidator infra changes for evaluating xpath expression (#19)
f3fc40f CVL Changes #1: Initial CVL code reorganization and common infra changes (#18)
4922601 Bulk and RPC API support in translib (#16)
1d730df RFC7895 yang module library implementation (#15)
li-pingmao pushed a commit to li-pingmao/sonic-buildimage that referenced this pull request Feb 23, 2022
* [BFN] Updated platform APIs impl

Signed-off-by: Andriy Kokhan <[email protected]>

* Extended BFN platform SFP APIs implementation

* Update sfp.py

* [BFN] Extended SFP platform plugin implementation

Signed-off-by: Andriy Kokhan <[email protected]>

* [BFN] Extended Fans platform plugin implementation

* [BFN] divided classes Fan and  FanDrawer into 2 files

* Signed-off-by: Vadym Yashchenko <[email protected]>

What I did
	Add get_model() function
	Add get_low_critical_threshold() function
	Change __get(...) function.
How I did it
	Differnece from previous implementation of __get(...) function is return real value or -9999.9 if value is not provided by thrift API

* Add get_presence() function and revised __get() function

Signed-off-by: Vadym Yashchenko <[email protected]>

* [BFN] Updated PSU platform APIs impl

Signed-off-by: Dmytro Lytvynenko <[email protected]>

* Added BFN PSU cache (zhenggen-xu#9)

Signed-off-by: Andriy Kokhan <[email protected]>

* [BFN]  Fans and Fantray platform APIs update (zhenggen-xu#7)

* [BFN] Updated SFP platform APIs (zhenggen-xu#10)

Signed-off-by: Volodymyr Boyko <[email protected]>

* [BFN] Updated platform API for thermal (zhenggen-xu#8)

* Signed-off-by: Vadym Yashchenko <[email protected]>

* Revert "[BFN]  Fans and Fantray platform APIs update (zhenggen-xu#7)" (zhenggen-xu#11)

This reverts commit c62a733.

* Add support health monitor system (zhenggen-xu#15)

Signed-off-by: Petro Bratash <[email protected]>

* Update chassis.py

* [BFN] Updated FANs and FAN Tray platform API (zhenggen-xu#14)

* Fix fix_alignment (zhenggen-xu#17)

Signed-off-by: Petro Bratash <[email protected]>

* [BFN] Improvement show environment (zhenggen-xu#16)

* Added PSU temperature skip into platform.json (zhenggen-xu#18)

Signed-off-by: Andriy Kokhan <[email protected]>

* Do not skip psud on Newport

Signed-off-by: Andriy Kokhan <[email protected]>

* [BFN] fix fan status from Not OK to Ok (zhenggen-xu#19)

* [BFN] Updated SFP platform plugin (zhenggen-xu#13)

Signed-off-by: Volodymyr Boyko <[email protected]>

* [DPB] Fix typo for Ethernet0 2x200G[100G,40G] breakout mode (zhenggen-xu#21)

Signed-off-by: Mykola Gerasymenko <[email protected]>

* [barefoot] Tmp fix vendor_rev (zhenggen-xu#22)

Signed-off-by: Volodymyr Boyko <[email protected]>

* Fixed python issues in sonic_platform/fan_drawer.py

Signed-off-by: Andriy Kokhan <[email protected]>

* Updated fan_drawer.py

* Fixing trailing white spaces in fan_drawer.py

* [BFN] Fix thrift for SFPs API

Signed-off-by: Volodymyr Boyko <[email protected]>

* In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue

Signed-off-by: Andriy Kokhan <[email protected]>

* [Newport] Thermal manager  (zhenggen-xu#23)

* Signed-off-by: Vadym Yashchenko <[email protected]>

* Revert "In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue"

This reverts commit 1e73127.

* Removed 'controllable' options from platform.json to fix factory default config generation

Signed-off-by: Andriy Kokhan <[email protected]>

* Update thermal_manager.py

* Migrated SFP plugin to sonic_xcvr API (zhenggen-xu#30)

Signed-off-by: Andriy Kokhan <[email protected]>

Co-authored-by: KostiantynYarovyiBf <[email protected]>
Co-authored-by: Vadym Yashchenko <[email protected]>
Co-authored-by: Dmytro Lytvynenko <[email protected]>
Co-authored-by: Volodymyr Boiko <[email protected]>
Co-authored-by: Petro Bratash <[email protected]>
Co-authored-by: Mykola Gerasymenko <[email protected]>
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 9, 2022
…-xu#7)

1. Fix build for armhf and arm64
2. upgrade centec tsingma bsp support to 5.10 kernel
3. modify centec platform driver for linux 5.10

Co-authored-by: Shi Lei <[email protected]>
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Oct 27, 2022
#### Why I did it
Update sonic-host-services submodule to include below commits:
```
bc8698d Merge pull request zhenggen-xu#21 from abdosi/feature
557a110 Fix the issue where if dest port is not specified in ACL rule than for multi-asic where we create NAT rule to forward traffic from Namespace to host fail with exception.
6e45acc (master) Merge pull request zhenggen-xu#14 from abdosi/feature
4d6cad7 Merge remote-tracking branch 'upstream/master' into feature
bceb13e Install libyang to azure pipeline (zhenggen-xu#20)
82299f5 Merge pull request zhenggen-xu#13 from SuvarnaMeenakshi/cacl_fabricns
15d3bf4 Merge branch 'master' into cacl_fabricns
de54082 Merge pull request zhenggen-xu#16 from ZhaohuiS/feature/caclmgrd_external_client_warning_log
b4b368d Add warning log if destination port is not defined
d4bb96d Merge branch 'master' into cacl_fabricns
35c76cb Add unit-test and fix typo.
17d44c2 Made Changes to be Python 3.7 compatible
978afb5 Aligning Code
1fbf8fb Merge remote-tracking branch 'upstream/master' into feature
7b8c7d1 Added UT for the changes
91c4c42 Merge pull request zhenggen-xu#9 from ZhaohuiS/feature/caclmgrd_external_client
7c0b56a Add 4 test cases for external_client_acl, including single port and port range for ipv4 and ipv6
b71e507 Merge remote-tracking branch 'origin/master' into HEAD
d992dc0 Merge branch 'master' into feature/caclmgrd_external_client
bd7b172 DST_PORT is configuralbe in json config file for EXTERNAL_CLIENT_ACL
f9af7ae [CLI] Move hostname, mgmt interface/vrf config to hostcfgd (zhenggen-xu#2)
70ce6a3 Merge pull request zhenggen-xu#10 from sujinmkang/cold_reset
29be8d2 Added Support to render Feature Table using Device running metadata. Also added support to render 'has_asic_scope' field of Feature Table.
3437e35 [caclmgrd][chassis]: Add ip tables rules to accept internal docker traffic from fabric asic namespaces.
8720561 Fix and add hardware reboot cause determination tests
0dcc7fe remove the empty bracket if no hardware reboot cause minor
e47d831 fix the wrong expected result comparision
ef86b53 Fix startswith Attribute error
8a630bb fix mock patch
8543ddf update the reboot cause logic and update the unit test
53ad7cd fix the mock patch function
7c8003d fix the reboot-cause regix for test
1ba611f fix typo
25379d3 Add unit test case
a56133b Add hardware reboot cause as actual reboot cause for soft reboot failed
c7d3833 Support Restapi/gnmi control plane acls
f6ea036 caclmgrd: Don't block traffic to mgmt by default
a712fc4 Update test cases
adc058b caclmgrd: Don't block traffic to mgmt by default
06ff918 Merge pull request zhenggen-xu#7 from bluecmd/patch-1
e3e23bc ci: Rename sonic-buildimage repository
e83a858 Merge pull request zhenggen-xu#4 from kamelnetworks/acl-ip2me-test
f5a2e50 [caclmgrd]: Tests for IP2ME rules generation
```
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Dec 23, 2022
zhenggen-xu pushed a commit that referenced this pull request May 24, 2024
Why I did it
Advance dhcpmon to a3c5381 in 202305 branch.

a3c5381 - (HEAD, origin/master, origin/HEAD, master) Merge pull request src: Add libnl3 build.sh script #11 from jcaiMR/dev/jcai_fix_err_log (11 days ago) [StormLiangMS]
c5ef7e7 - Change common_libs dependencies from buster to bullseye (Updating docker-orchagent/syncd Dockerfile and start.sh #9)
824a144 - replace atoi with strtol (Rename hostname #6) (10 weeks ago) [Mai Bui]
32c0c3f - Fix libswsscommon package installation for non-amd64 (README.md leaves out docker-database #7) (10 weeks ago) [Saikrishna Arcot]
Work item tracking
Microsoft ADO (25048723):
How I did it
How to verify it
Run test_dhcp_relay.py, no failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants