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] [asan] add graceful stop flag #2347

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def pytest_addoption(parser):
default="traditional",
help="Buffer model")

parser.addoption("--graceful-stop",
action="store_true",
default=False,
help="Stop swss before stopping a conatainer")


def random_string(size=4, chars=string.ascii_uppercase + string.digits):
return "".join(random.choice(chars) for x in range(size))
Expand Down Expand Up @@ -1730,6 +1735,8 @@ def manage_dvs(request) -> str:
max_cpu = request.config.getoption("--max_cpu")
buffer_model = request.config.getoption("--buffer_model")
force_recreate = request.config.getoption("--force-recreate-dvs")
graceful_stop = request.config.getoption("--graceful-stop")

dvs = None
curr_dvs_env = [] # lgtm[py/unused-local-variable]

Expand Down Expand Up @@ -1778,6 +1785,8 @@ def update_dvs(log_path, new_dvs_env=[]):

yield update_dvs

if graceful_stop:
dvs.stop_swss()
dvs.get_logs()
dvs.destroy()

Expand Down