From 57150b44a6dfa19a28447c4f37448534d35fdca3 Mon Sep 17 00:00:00 2001 From: Misbah Anjum N Date: Wed, 20 Mar 2024 03:42:55 -0500 Subject: [PATCH] trace: Add Fedora Support to trace testing Added distros "fedora", "centos" in trace_UDT_probes.py for installing packages: "perf", "systemtap-sdt-devel.ppc64le" Added self.distro_name == "fedora" in perf_uprobe.py for testing of "perf record .." command Added self.distro_name == "fedora" in dawr.py to enable extra setting required to run gdb for fedora Signed-off-by: Misbah Anjum N --- trace/dawr.py | 7 +++++++ trace/perf_uprobe.py | 3 ++- trace/trace_UDT_probes.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/trace/dawr.py b/trace/dawr.py index 07be8c4f1..ede4b5303 100644 --- a/trace/dawr.py +++ b/trace/dawr.py @@ -68,6 +68,10 @@ def test_read_dawr_v1(self): executing the program """ child, return_value = self.run_cmd('dawr_v1') + i = 0 + if self.distro_name == "fedora": + child.sendline('set debuginfod enabled on') + child.expect_exact([pexpect.TIMEOUT, '']) child.sendline('awatch a') return_value.append(child.expect_exact(['watchpoint 1: a', pexpect.TIMEOUT])) @@ -88,6 +92,9 @@ def test_read_dawr_v2(self): """ child, return_value = self.run_cmd('dawr_v2') i = 0 + if self.distro_name == "fedora": + child.sendline('set debuginfod enabled on') + child.expect_exact([pexpect.TIMEOUT, '']) for value in ['a', 'b']: i = i+1 child.sendline('awatch %s' % value) diff --git a/trace/perf_uprobe.py b/trace/perf_uprobe.py index f1e26eaaf..19095bc0b 100644 --- a/trace/perf_uprobe.py +++ b/trace/perf_uprobe.py @@ -98,7 +98,8 @@ def test_uprobe_return(self): if (self.distro_name == "rhel" and self.detected_distro.version > "7")\ or (self.distro_name == "SuSE" and self.detected_distro.version >= 15 and - self.detected_distro.release >= 2): + self.detected_distro.release >= 2)\ + or (self.distro_name == "fedora"): output = self.cmd_verify('%s__return -- ./uprobe_test' % self.recProbe) else: diff --git a/trace/trace_UDT_probes.py b/trace/trace_UDT_probes.py index 0f40b1261..37dec4af2 100644 --- a/trace/trace_UDT_probes.py +++ b/trace/trace_UDT_probes.py @@ -36,7 +36,7 @@ def setUp(self): if 'Ubuntu' in self.distro_name: deps.extend(['linux-tools-common', 'linux-tools-%s' % platform.uname()[2]]) - elif self.distro_name in ['rhel', 'SuSE']: + elif self.distro_name in ['rhel', 'SuSE', 'fedora', 'centos']: deps.extend(['perf', 'systemtap-sdt-devel.ppc64le']) else: self.cancel("Install the package for perf supported\