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

[tests/conftest.py]: new API runcmd_interactive. #1424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

praveen-li
Copy link

Changes:
-- new API runcmd_interactive to execute a command in interactive mode.
Usage: Say in a Test, we want to run "config save" and want to pass
confirmation later.

Signed-off-by: Praveen Chaudhary [email protected]

What I did
Changes:
-- new API runcmd_interactive to execute a command in interactive mode.
Usage: Say in a Test, we want to run "config save" and want to pass
confirmation later.

Why I did it
Need such command for tests like below:

                exitCode, child = self.dvs.runcmd_interactive('config save')
                # -- AcquireLock.
                child.settimeout(3)
                out = str(child.recv(RECV_SIZE))
                assert 'continue' in out
                # -- send No
                child.send("N"+"\n")
                out = str(child.recv(RECV_SIZE))
                assert 'Aborted' in out
                child.close()

How I verified it
Wrote test which uses it, for lock in configDB. These tests are not pushed in Azure but we need interactive command to run better tests anyways.

~/praveen/sonic-swss/tests$ sudo pytest --pdb --dvsname=vs-jk test_config_lock.py --junitxml=report.xml
============================================================ test session starts ============================================================
platform linux2 -- Python 2.7.17, pytest-3.3.0, py-1.8.0, pluggy-0.6.0
rootdir: /home/falco/praveen/sonic-swss/tests, inifile:
collected 5 items

test_config_lock.py .....                                                                                                             [100%]

------------------------------------ generated xml file: /home/falco/praveen/sonic-swss/tests/report.xml ------------------------------------
======================================================== 5 passed in 108.65 seconds =========================================================

Details if related

@praveen-li
Copy link
Author

retest vs please

Changes:
-- new API runcmd_interactive to execute a command in interactive mode.
Usage: Say in a Test, we want to run "config save" and want to pass
confirmation later.

Signed-off-by: Praveen Chaudhary <[email protected]>
@praveen-li praveen-li force-pushed the runcmd_interactive branch from 0a16350 to 11f01f7 Compare March 4, 2021 06:37
@praveen-li
Copy link
Author

@lguohan kindly review. This API to run command in interactive mode will be useful for tests. Thx.

-- new API runcmd_interactive to execute a command in interactive mode.
Usage: Say in a Test, we want to run "config save" and want to pass
confirmation later.

@praveen-li
Copy link
Author

/AzurePipelines run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1424 in repo Azure/sonic-swss

@praveen-li
Copy link
Author

@jleveque : How can I run only 'Azure.sonic-swss'. thx

@prsunny prsunny self-requested a review as a code owner September 2, 2022 23:17
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
Update SAI submodule v1.9 with the following fixes

7594e53 (HEAD, origin/v1.9) Skip brcm teardown assertion (sonic-net#1423) (sonic-net#1428)
0c33f4a [FIX]Fix the circular reference issue when build sai header py (sonic-net#1427)
7e0fc24 Add support for building under Doxygen 1.9.1 (sonic-net#1414) (sonic-net#1424)
8ecf3ef [Fix]Correct enum check on branch 1.9 (sonic-net#1418)
e2b2f39 Add Thrift 0.14.1 compatibility (sonic-net#1403) (sonic-net#1416)
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