-
Notifications
You must be signed in to change notification settings - Fork 301
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
DAOS-16585 tests: Fix NLT handling of __fxstat detection #15150
base: master
Are you sure you want to change the base?
Changes from 2 commits
ad18961
b5d2047
6660ef1
8bd1379
1472202
274a319
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1521,8 +1521,8 @@ | |||
print(f'Logged il to {log_name}') | ||||
print(ret) | ||||
|
||||
if self.caching: | ||||
check_fstat = False | ||||
check_fstat = check_fstat and not self.caching and \ | ||||
look_for_library_call(self.conf, cmd, '__fxstat') | ||||
|
||||
try: | ||||
log_test(self.conf, log_name, check_read=check_read, check_write=check_write, | ||||
|
@@ -6327,6 +6327,23 @@ | |||
server.set_fi(probability=0) | ||||
|
||||
|
||||
def look_for_library_call(conf, cmd, library_str): | ||||
"""Look for library_str in the strace call stack of running cmd.""" | ||||
tmpfile = tempfile.NamedTemporaryFile(mode='r', | ||||
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. I don't recall if pylint will still complain on every PR thereafter but it used to be the case. You could either remove strace from the comment or add a comment such as Line 3402 in b5d2047
|
||||
prefix='dnt_assess_', | ||||
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. this one is simple enough to address, then you don't need explicit close |
||||
suffix='.strace', | ||||
dir=conf.tmp_dir) | ||||
strace_cmd = ['strace', '--stack-traces', '-v', '-o', tmpfile.name] + cmd | ||||
subprocess.run(strace_cmd, check=True) | ||||
lines = tmpfile.readlines() | ||||
tmpfile.close() | ||||
for line in lines: | ||||
if re.search(library_str, line): | ||||
return True | ||||
|
||||
return False | ||||
|
||||
|
||||
def run(wf, args): | ||||
"""Main entry point""" | ||||
# pylint: disable=too-many-branches | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ dnf --nodocs install \ | |
python3-devel \ | ||
scons \ | ||
sg3_utils \ | ||
strace \ | ||
sudo \ | ||
valgrind-devel \ | ||
which \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ apt-get install \ | |
pkg-config \ | ||
python3-dev \ | ||
python3-venv \ | ||
strace \ | ||
uuid-dev \ | ||
valgrind \ | ||
yasm | ||
|
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.
This would be called for every il_cmd invocation and there are probably dozens so it could/should be saved in
conf
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.
I thought about that and wanted to not assume different executables ended up using the same libraries. And, I don't think it's going to affect overall runtime to just do this every time. Do you feel differently?
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.
I'd missed that it was running the actual command rather than just a generic unix command here. This means the command has to be idempotent and perform the same operations on subsequent invocations but looking at the places where this is called it seems it probably is.