Skip to content

Commit b976629

Browse files
Merge pull request #790 from PraveenPenguin/new_fix
Moved testcase logic to use generic kernel path
2 parents 35ee74b + 9593c02 commit b976629

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

testcases/GcovSetup.py

+5
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,17 @@ def runTest(self):
6969
src_path = self.util.get_distro_src('kernel', '/root', "-bp")
7070
elif self.distro_name == 'sles':
7171
src_path = self.util.get_distro_src('kernel-default', '/root', "-bp")
72+
src_path_base = src_path
7273
out = self.cv_HOST.host_run_command(f"ls {src_path}")
7374
for line in out:
7475
if line.startswith("linux-"):
7576
src_path = os.path.join(src_path, line)
7677
break
7778
log.info("\n\nsource path = %s" %src_path)
79+
self.cv_HOST.host_run_command('mkdir -p /root/kernel')
80+
self.cv_HOST.host_run_command('mv %s /root/kernel/linux' %src_path)
81+
self.cv_HOST.host_run_command('rm -rf %s' %src_path_base)
82+
src_path = '/root/kernel/linux'
7883
log.info("\nadding gcov_param....")
7984
self.kernel_config(src_path)
8085
log.info("Building the new kernel...")

testcases/Lcov.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def setUp(self):
5353
self.util = OpTestUtil(OpTestConfiguration.conf)
5454
self.c = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
5555
self.distro = self.util.distro_name()
56-
self.k_version = "".join(self.cv_HOST.host_run_command("uname -r"))
5756

5857
def runTest(self):
5958
'''
@@ -102,8 +101,7 @@ def runTest(self):
102101
Running the test
103102
'''
104103
self.c = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
105-
self.k_version = "".join(self.cv_HOST.host_run_command("uname -r"))
106-
src_path = f'/root/kernel-{self.k_version}*/linux-{self.k_version}*'
104+
src_path = f'/root/kernel/linux'
107105
self.cv_HOST.host_run_command(f"cd {src_path}")
108106
src_path = "".join(self.cv_HOST.host_run_command("pwd"))
109107
temp_dir = tempfile.mkdtemp(prefix="Lcov_result_")

0 commit comments

Comments
 (0)