Skip to content

Commit

Permalink
DAOS-16585 tests: Fix NLT handling of __fxstat detection
Browse files Browse the repository at this point in the history
Use strace to determine whether calls to __fxstat actually happen
when using a utility/command the IL is being tested on, and stop
treating it as an error to not see __fxstat when it's not used.

Signed-off-by: Nicholas Murphy <ncmurphy@google.com>
Required-githooks: true
  • Loading branch information
techbasset committed Sep 18, 2024
1 parent cdd3744 commit 14f3e0e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
21 changes: 19 additions & 2 deletions utils/node_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,8 +1521,8 @@ def il_cmd(self, cmd, check_read=True, check_write=True, check_fstat=True):
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,
Expand Down Expand Up @@ -6327,6 +6327,23 @@ def server_fi(args):
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."""

Check warning on line 6331 in utils/node_local_test.py

View workflow job for this annotation

GitHub Actions / Pylint check

wrong-spelling-in-docstring, Wrong spelling of a word 'strace' in a docstring:
tmpfile = tempfile.NamedTemporaryFile(mode='r',

Check warning on line 6332 in utils/node_local_test.py

View workflow job for this annotation

GitHub Actions / Pylint check

consider-using-with, Consider using 'with' for resource-allocating operations
prefix='dnt_assess_',
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
Expand Down
1 change: 1 addition & 0 deletions utils/scripts/install-el8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dnf --nodocs install \
python3-devel \
python3-pip \
sg3_utils \
strace \
sudo \
systemd \
valgrind-devel \
Expand Down
1 change: 1 addition & 0 deletions utils/scripts/install-el9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dnf --nodocs install \
python3-devel \
python3-pip \
sg3_utils \
strace \
sudo \
valgrind-devel \
which \
Expand Down
1 change: 1 addition & 0 deletions utils/scripts/install-leap15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dnf --nodocs install \
python3-devel \
scons \
sg3_utils \
strace \
sudo \
valgrind-devel \
which \
Expand Down
1 change: 1 addition & 0 deletions utils/scripts/install-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ apt-get install \
pkg-config \
python3-dev \
python3-venv \
strace \
uuid-dev \
valgrind \
yasm
Expand Down

0 comments on commit 14f3e0e

Please sign in to comment.