sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
200 stars 732 forks source link

Fix for inconsistent container autorestart state for multi_asic chassis #15647

Open ansrajpu-git opened 1 week ago

ansrajpu-git commented 1 week ago

Description of PR

The disable_container_autorestart func in tests/conftest.py sometimes fails in qos test for multi_asic chassis due to the container inconsistent autorestart state across namespace. Prior running qos test, few services are stopped and container autorestart feature is disabled. While disabling, if the autorestart state of the feature at asic-level is not in sync with the host level, the test error with Feature 'xxx' auto-restart is not consistent across namespaces

:~$ show feature autorestart Feature AutoRestart


acms enabled bgp enabled database always_enabled dhcp_relay enabled lldp enabled macsec enabled mux enabled pmon enabled radv enabled restapi enabled snmp enabled swss enabled syncd enabled teamd enabled telemetry enabled :~$ sudo ip netns exec asic0 show feature autorestart Feature AutoRestart


acms enabled bgp disabled database always_enabled dhcp_relay enabled lldp enabled macsec enabled mux enabled pmon enabled radv enabled restapi enabled snmp enabled swss enabled syncd enabled teamd enabled telemetry enabled :~$ sudo ip netns exec asic1 show feature autorestart Feature AutoRestart


acms enabled bgp enabled database always_enabled dhcp_relay enabled lldp enabled macsec enabled mux enabled pmon enabled radv enabled restapi enabled snmp enabled swss enabled syncd enabled teamd enabled telemetry enabled :~$ sudo config feature autorestart bgp disabled Feature 'bgp' auto-restart is not consistent across namespaces Summary:

Fixes # (issue) Feature 'xxx' auto-restart is not consistent across namespaces

Type of change

Back port request

Approach

For the multi_asic chassis, Before disabling the container autorestart, make sure the autorestart state of the selected container is same at asic-level and host level

What is the motivation for this PR?

qos test failures with error "Feature 'xxx' auto-restart is not consistent across namespaces"

How did you do it?

How did you verify/test it?

Ran qos test suite and verify the results

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

ansrajpu-git commented 4 days ago

@arlakshm @vmittal-msft , please review