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

[pytest] Skip testing the format of alerting message from Monit on 202012 image #3559

Merged
merged 2 commits into from
Jun 1, 2021

Conversation

yozhao101
Copy link
Contributor

@yozhao101 yozhao101 commented May 31, 2021

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

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

Since Supervisord will replace Monit to do the monitoring of critical processes, this test needs skip the testbeds which were installed with 202012 or newer image version. At the same time, this test needs handle the error if the command sudo monit status 'lldp|lldpmgrd' returns the non-zero exit code.

I met the following error message when this PR (sonic-net/sonic-buildimage#7676) was tested on virtual testbed.

monit/test_monit_status.py::test_monit_status[vlab-03] PASSED            [ 50%]
monit/test_monit_status.py::test_monit_reporting_message[vlab-03] 
-------------------------------- live log call ---------------------------------
02:11:26 utilities.wait_until                     L0068 ERROR  | Exception caught while checking check_monit_last_output: IndexError('list index out of range',)
02:12:26 utilities.wait_until                     L0068 ERROR  | Exception caught while checking check_monit_last_output: IndexError('list index out of range',)
02:13:27 utilities.wait_until                     L0068 ERROR  | Exception caught while checking check_monit_last_output: IndexError('list index out of range',)
FAILED   

How did you do it?

I used the pytest_require(...) to skip the testbed which were installed 202012 or newer image version.

How did you verify/test it?

I verified this change on the testbed str-msn2700-03.

Any platform specific information?

N/A

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

N/A

Documentation

and newer image version.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101 yozhao101 requested a review from a team as a code owner May 31, 2021 18:27
@yozhao101 yozhao101 changed the title [Monit] Skip testing the format of alerting message from Monit on 202012 [Monit] Skip testing the format of alerting message from Monit on 202012 image May 31, 2021
@yozhao101 yozhao101 changed the title [Monit] Skip testing the format of alerting message from Monit on 202012 image [pytest] Skip testing the format of alerting message from Monit on 202012 image May 31, 2021
@yozhao101 yozhao101 requested review from jleveque and abdosi June 1, 2021 06:02
skip testing the 202012 image.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101 yozhao101 merged commit 5634dd0 into sonic-net:master Jun 1, 2021
@yozhao101 yozhao101 deleted the fix_monit_status_test branch June 1, 2021 18:25
@lgtm-com
Copy link

lgtm-com bot commented Jun 1, 2021

This pull request introduces 1 alert when merging 7592f1c into e27602e - view on LGTM.com

new alerts:

  • 1 for Unused import

vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…2012 image (sonic-net#3559)

What is the motivation for this PR?
Since Supervisord will replace Monit to do the monitoring of critical processes, this test needs skip the testbeds which were installed with 202012 or newer image version. At the same time, this test needs handle the error if the command sudo monit status 'lldp|lldpmgrd' returns the non-zero exit code.

I met the following error message when this PR (sonic-net/sonic-buildimage#7676) was tested on virtual testbed.

monit/test_monit_status.py::test_monit_status[vlab-03] PASSED            [ 50%]
monit/test_monit_status.py::test_monit_reporting_message[vlab-03] 
-------------------------------- live log call ---------------------------------
02:11:26 utilities.wait_until                     L0068 ERROR  | Exception caught while checking check_monit_last_output: IndexError('list index out of range',)
02:12:26 utilities.wait_until                     L0068 ERROR  | Exception caught while checking check_monit_last_output: IndexError('list index out of range',)
02:13:27 utilities.wait_until                     L0068 ERROR  | Exception caught while checking check_monit_last_output: IndexError('list index out of range',)
FAILED   

How did you do it?
I used the pytest_require(...) to skip the testbed which were installed 202012 or newer image version.

How did you verify/test it?
I verified this change on the testbed str-msn2700-03.

Any platform specific information?
N/A

Supported testbed topology if it's a new test case?
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants