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

[auto-ts] Updated regex in test_auto_techsupport #5924

Merged

Conversation

AndriiLozovyi
Copy link
Contributor

Signed-off-by: Andrii-Yosafat Lozovyi andrii-yosafatx.lozovyi@intel.com

Description of PR

Summary:
In PR - 10433 were added changes that add automatic techsupport invocation in case memory usage is too high. After this PR output of Cli cmd's (show auto-techsupport global, show auto-techsupport-feature, show auto-techsupport history) changed and TC's are failing to parse the output on SONiC images SONiC.master.112803-dirty-20220621.160636 or higher .

     if since:
            with allure.step('Checking global since'):
>               assert str(current_since) == str(since), \
                    'Wrong configuration for since: {} expected: {}'.format(current_since, since)
E               AssertionError: Wrong configuration for since: 10                             200                       2 days ago expected: 2 days ago
E               assert '10          ...   2 days ago' == '2 days ago'
E                 - 10                             200                       2 days ago
E                 + 2 days ago

This PR updates the regex to properly parse the output in both cases (when TC will run on Sonic image that doesn't include changes in 10433 or in case when Sonic image have this changes SONiC.master.112803-dirty-20220621.160636 or higher)

Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012

Approach

What is the motivation for this PR?

Update the regex to properly parse the output of cli cmd's on newer SONiC images

How did you do it?

How did you verify/test it?

Run TC on Sonic image SONiC.master.112803-dirty-20220621.160636 and SONiC.master.105614-dirty-20220602.215204

Any platform specific information?

SONiC Software Version: SONiC.master.117621-dirty-20220703.113429
Distribution: Debian 11.3
Kernel: 5.10.0-12-2-amd64
Build commit: 23d68883f
Build date: Sun Jul  3 16:43:57 UTC 2022
Built by: AzDevOps@sonic-build-workers-001PX8
Platform: x86_64-arista_7170_64c
HwSKU: Arista-7170-64C

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

Documentation

Signed-off-by: Andrii-Yosafat Lozovyi <andrii-yosafatx.lozovyi@intel.com>
@AndriiLozovyi AndriiLozovyi requested a review from yxieca as a code owner July 4, 2022 15:36
@AndriiLozovyi
Copy link
Contributor Author

@ZhaohuiS Could you please take a look?

result_dict = {'state': state, 'rate_limit_interval': rate_limit_interval,
'max_techsupport_limit': max_techsupport_limit, 'max_core_size': max_core_size, 'since': since}
'max_techsupport_limit': max_techsupport_limit, 'max_core_size': max_core_size,
'available_mem_thresh': available_mem_thresh, 'min_available_mem': min_available_mem, 'since': since}
Copy link
Contributor

Choose a reason for hiding this comment

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

@AndriiLozovyi If the command is changed again, we have to rewrite this function one more time. Could you please check if it's possible to call show_and_parse, doc is here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ZhaohuiS
Good suggestion, reworked to use show_and_parse instead of regex

Signed-off-by: Andrii-Yosafat Lozovyi <andrii-yosafatx.lozovyi@intel.com>
@lgtm-com
Copy link

lgtm-com bot commented Jul 15, 2022

This pull request introduces 1 alert when merging 26135fa into f7bde1e - view on LGTM.com

new alerts:

  • 1 for Unused import

@ZhaohuiS ZhaohuiS merged commit 031510b into sonic-net:master Jul 17, 2022
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.

2 participants