-
Notifications
You must be signed in to change notification settings - Fork 711
[Auto-Techsupport] Issues related to Multiple Cores crashing handled #1948
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac90856
event_driven_ts paralell crash related bugs handled
vivekrnv f110ebb
Merge branch 'Azure:master' into event_driv_ts_bug
vivekrnv 82da851
Update coredump_gen_handler.py
vivekrnv b7c156b
Update coredump_gen_handler_test.py
vivekrnv 48b1a0f
Merge branch 'Azure:master' into event_driv_ts_bug
vivekrnv f8fc84b
Merge branch 'Azure:master' into event_driv_ts_bug
vivekrnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,11 @@ | |
sys.path.append("scripts") | ||
import coredump_gen_handler as cdump_mod | ||
|
||
AUTO_TS_STDOUT=""" | ||
Techsupport is running with silent option. This command might take a long time. | ||
The SAI dump is generated to /tmp/saisdkdump/sai_sdk_dump_11_22_2021_11_07_PM | ||
/tmp/saisdkdump | ||
""" | ||
|
||
def set_auto_ts_cfg(redis_mock, state="disabled", | ||
rate_limit_interval="0", | ||
|
@@ -74,12 +79,13 @@ def test_invoc_ts_state_db_update(self): | |
populate_state_db(redis_mock) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/dump/sonic_dump_random2.tar.gz") | ||
|
@@ -105,12 +111,13 @@ def test_global_rate_limit_interval(self): | |
populate_state_db(redis_mock) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/dump/sonic_dump_random2.tar.gz") | ||
|
@@ -138,12 +145,13 @@ def test_per_container_rate_limit_interval(self): | |
"orchagent;{};swss".format(int(time.time()))}) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/core/orchagent.12345.123.core.gz") | ||
|
@@ -167,12 +175,13 @@ def test_invoc_ts_after_rate_limit_interval(self): | |
"orchagent;{};swss".format(int(time.time()))}) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/dump/sonic_dump_random2.tar.gz") | ||
|
@@ -197,12 +206,13 @@ def test_core_dump_with_invalid_container_name(self): | |
populate_state_db(redis_mock, {}) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/core/snmpd.12345.123.core.gz") | ||
|
@@ -225,12 +235,13 @@ def test_feature_table_not_set(self): | |
populate_state_db(redis_mock, {}) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/core/python3.12345.123.core.gz") | ||
|
@@ -251,10 +262,11 @@ def test_since_argument(self): | |
populate_state_db(redis_mock) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport --since '4 days ago'" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
return 0, "", "" | ||
if "--since '4 days ago'" in cmd_str: | ||
patcher.fs.create_file(ts_dump) | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
elif "date --date='4 days ago'" in cmd_str: | ||
return 0, "", "" | ||
else: | ||
|
@@ -284,12 +296,13 @@ def test_masic_core_dump(self): | |
populate_state_db(redis_mock) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
patcher.fs.create_file(ts_dump) | ||
else: | ||
return 1, "", "Command Not Found" | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
cdump_mod.subprocess_exec = mock_cmd | ||
patcher.fs.create_file("/var/dump/sonic_dump_random1.tar.gz") | ||
patcher.fs.create_file("/var/dump/sonic_dump_random2.tar.gz") | ||
|
@@ -315,10 +328,13 @@ def test_invalid_since_argument(self): | |
populate_state_db(redis_mock) | ||
with Patcher() as patcher: | ||
def mock_cmd(cmd, env): | ||
ts_dump = "/var/dump/sonic_dump_random3.tar.gz" | ||
cmd_str = " ".join(cmd) | ||
if "show techsupport --since '2 days ago'" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
return 0, "", "" | ||
print(cmd_str) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is print used for debug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, Will remove |
||
if "--since '2 days ago'" in cmd_str: | ||
patcher.fs.create_file(ts_dump) | ||
print(AUTO_TS_STDOUT + ts_dump) | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
elif "date --date='whatever'" in cmd_str: | ||
return 1, "", "Invalid Date Format" | ||
else: | ||
|
@@ -370,7 +386,7 @@ def mock_cmd(cmd, env): | |
cmd_str = " ".join(cmd) | ||
if "show techsupport" in cmd_str: | ||
patcher.fs.create_file("/var/dump/sonic_dump_random3.tar.gz") | ||
return 0, "", "" | ||
return 0, AUTO_TS_STDOUT + ts_dump, "" | ||
patcher.fs.set_disk_usage(2000, path="/var/core/") | ||
patcher.fs.create_file("/var/core/orchagent.12345.123.core.gz", st_size=25) | ||
patcher.fs.create_file("/var/core/lldpmgrd.12345.22.core.gz", st_size=25) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else is not necessary here.