Skip to content

Commit

Permalink
ltp_fs : resolve interactive user check
Browse files Browse the repository at this point in the history
With latest ltp source, a user id check has been added
causing the test to wait for user response to this check

..user ids and/or groups are missing, would you like these created? [y/N]

This code solves this check by passing the 'y' string to
automatically proceed the test

Signed-off-by: Abdul Haleem <[email protected]>
  • Loading branch information
abdhaleegit committed Feb 28, 2024
1 parent f9427aa commit 35bb5b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion generic/ltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,13 @@ def test(self):
skipfilepath))
if self.mem_leak:
self.args += " -M %s" % self.mem_leak
cmd = "%s %s" % (os.path.join(self.ltpbin_dir, 'runltp'), self.args)
self.ltpbin_path = os.path.join(self.ltpbin_dir, 'runltp')
with open(self.ltpbin_path, 'r') as lfile:
data = lfile.read()
data = data.replace(" ${LTPROOT}/IDcheck.sh || \\", " echo -e \"y\" | ${LTPROOT}/IDcheck.sh || \\")
with open(self.ltpbin_path, 'w') as ofile:
ofile.write(data)
cmd = '%s %s' % (self.ltpbin_path, self.args)
process.run(cmd, ignore_status=True)
# Walk the ltp.log and try detect failed tests from lines like these:
# msgctl04 FAIL 2
Expand Down
9 changes: 7 additions & 2 deletions io/disk/ltp_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,13 @@ def test_fs_run(self):
self.args += (" -q -p -l %s -C %s -d %s"
% (logfile, failcmdfile, self.dir))
self.log.info("Args = %s", self.args)
cmd = '%s %s' % (os.path.join(self.ltpbin_dir, 'runltp'),
self.args)
self.ltpbin_path = os.path.join(self.ltpbin_dir, 'runltp')
with open(self.ltpbin_path, 'r') as lfile:
data = lfile.read()
data = data.replace(" ${LTPROOT}/IDcheck.sh || \\", " echo -e \"y\" | ${LTPROOT}/IDcheck.sh || \\")
with open(self.ltpbin_path, 'w') as ofile:
ofile.write(data)
cmd = '%s %s' % (self.ltpbin_path, self.args)
result = process.run(cmd, ignore_status=True)
# Walk the stdout and try detect failed tests from lines
# like these:
Expand Down

0 comments on commit 35bb5b6

Please sign in to comment.