diff options
-rw-r--r-- | tests/sos_tests.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/sos_tests.py b/tests/sos_tests.py index 78c23e43..d15395f0 100644 --- a/tests/sos_tests.py +++ b/tests/sos_tests.py @@ -390,11 +390,16 @@ class BaseSoSReportTest(BaseSoSTest): raise return _archive - def grep_for_content(self, search): + def grep_for_content(self, search, regexp=False): """Call out to grep for finding a specific string 'search' in any place in the archive + + :param search: string to search + :param regexp: use regular expression search (default False + means "grep -F") """ - cmd = "grep -ril '%s' %s" % (search, self.archive_path) + fixed_opt = "" if regexp else "F" + cmd = "grep -ril%s '%s' %s" % (fixed_opt, search, self.archive_path) try: out = process.run(cmd) rc = out.exit_status |