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

[show/config] The subcommands related to features of high memory restart and memory threshold. #1738

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yozhao101
Copy link
Contributor

@yozhao101 yozhao101 commented Aug 2, 2021

Signed-off-by: Yong Zhao yozhao@microsoft.com

What I did

This PR aims to implement the subcommands of show/config which can help users configure the status of high memory restart and memory threshold of a specific container.

How I did it

I implemented two functions in config/feature.py and show/feature.py files separately according to the following logic:

  • Check whether the container is configured in the FEATURE table of CONFIG_DB
  • Check whether the high_mem_restart or mem_threshold field exists in configuration of the container
  • Get or update the value of high_mem_restart or mem_threshold field which was provided by user

How to verify it

I tested this implementation on DuT str-msn2700-01.

Test result of Unit Test:

        test/feature_test.py::TestFeature::test_show_feature_status_no_kube_status PASSED                                                                               
        tests/feature_test.py::TestFeature::test_show_feature_status PASSED                                                                                              
        tests/feature_test.py::TestFeature::test_show_feature_config PASSED                                                                                             
        tests/feature_test.py::TestFeature::test_show_feature_status_abbrev_cmd PASSED                                                                                 
        tests/feature_test.py::TestFeature::test_show_bgp_feature_status PASSED                                                                                         
        tests/feature_test.py::TestFeature::test_show_unknown_feature_status PASSED                                                                                     
        tests/feature_test.py::TestFeature::test_show_feature_autorestart PASSED                                                                                         
        tests/feature_test.py::TestFeature::test_fail_autorestart PASSED                                                                                                 
        tests/feature_test.py::TestFeature::test_show_bgp_autorestart_status PASSED                                                                                      
        tests/feature_test.py::TestFeature::test_show_unknown_autorestart_status PASSED                                                                                  
        tests/feature_test.py::TestFeature::test_config_bgp_feature_state PASSED                                                                                         
        tests/feature_test.py::TestFeature::test_config_snmp_feature_owner PASSED                                                                                        
        tests/feature_test.py::TestFeature::test_config_unknown_feature_owner PASSED                                                                                     
        tests/feature_test.py::TestFeature::test_config_snmp_feature_fallback PASSED                                                                                     
        tests/feature_test.py::TestFeature::test_config_bgp_autorestart PASSED                                                                                           
        tests/feature_test.py::TestFeature::test_config_database_feature_state PASSED                                                                                    
        tests/feature_test.py::TestFeature::test_config_database_feature_autorestart PASSED                                                                              
        tests/feature_test.py::TestFeature::test_config_unknown_feature PASSED                                                                                           
        tests/feature_test.py::TestFeature::test_config_lldp_feature_high_mem_restart PASSED                                                                             
        tests/feature_test.py::TestFeature::test_config_lldp_feature_mem_threshold PASSED                                                                                
        tests/feature_test.py::TestFeatureMultiAsic::test_config_bgp_feature_inconsistent_state PASSED                                                                   
        tests/feature_test.py::TestFeatureMultiAsic::test_config_bgp_feature_inconsistent_autorestart PASSED                                                             
        tests/feature_test.py::TestFeatureMultiAsic::test_config_bgp_feature_consistent_state PASSED                                                                     
        tests/feature_test.py::TestFeatureMultiAsic::test_config_bgp_feature_consistent_autorestart PASSED                                                              

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

…memory

restart status and memory threshold of a container.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…st cases.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101 yozhao101 changed the title [config] Enable/disable high memory restart and set memory threshold of a container [show/config] The subcommands related to features of high memory restart and memory threshold. Aug 4, 2021
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101 yozhao101 requested a review from qiluo-msft August 5, 2021 16:29
@yozhao101 yozhao101 marked this pull request as ready for review August 5, 2021 16:29
@yozhao101
Copy link
Contributor Author

/Azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

1 participant