Skip to content

Commit b35fc35

Browse files
committed
io/iommu: Add support to capture warn,alert,err,crit logs for specific keywords
Currently test fails for any test specific 'warn,alert,crit,err' dmesg logs. But user may be interested for logs specific to iommu kernel driver. This patch adds support to pass specific keywords for filtering the dmesg logs to conclude pass or fail for the test. Signed-off-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
1 parent 9680957 commit b35fc35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

io/iommu/iommu_tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def setUp(self):
9191
self.pci_devices = self.params.get('pci_devices', default=None)
9292
self.count = int(self.params.get('count', default=1))
9393
self.domains = ["DMA", "DMA-FQ", "identity", "auto"]
94+
self.dmesg_grep = self.params.get('dmesg_grep', default='')
9495
if not self.pci_devices:
9596
self.cancel("No pci device given")
9697
smm = SoftwareManager()
@@ -397,6 +398,8 @@ def check_dmesg(self):
397398
process.run(cmd, ignore_status=True, shell=True, sudo=True)
398399

399400
cmd = "diff dmesg_final.txt dmesg_initial.txt"
401+
if self.dmesg_grep != '':
402+
cmd = f"{cmd} | grep -i -e '{self.dmesg_grep}'"
400403
dmesg_diff = process.run(cmd, ignore_status=True, shell=True, sudo=True).stdout_text
401404
if dmesg_diff != '':
402405
self.whiteboard = f"{dmesg_diff}"

0 commit comments

Comments
 (0)