Skip to content

Commit

Permalink
Merge pull request #790 from PraveenPenguin/new_fix
Browse files Browse the repository at this point in the history
Moved testcase logic to use generic kernel path
  • Loading branch information
PraveenPenguin committed Oct 6, 2023
2 parents 35ee74b + 9593c02 commit b976629
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions testcases/GcovSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ def runTest(self):
src_path = self.util.get_distro_src('kernel', '/root', "-bp")
elif self.distro_name == 'sles':
src_path = self.util.get_distro_src('kernel-default', '/root', "-bp")
src_path_base = src_path
out = self.cv_HOST.host_run_command(f"ls {src_path}")
for line in out:
if line.startswith("linux-"):
src_path = os.path.join(src_path, line)
break
log.info("\n\nsource path = %s" %src_path)
self.cv_HOST.host_run_command('mkdir -p /root/kernel')
self.cv_HOST.host_run_command('mv %s /root/kernel/linux' %src_path)
self.cv_HOST.host_run_command('rm -rf %s' %src_path_base)
src_path = '/root/kernel/linux'
log.info("\nadding gcov_param....")
self.kernel_config(src_path)
log.info("Building the new kernel...")
Expand Down
4 changes: 1 addition & 3 deletions testcases/Lcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def setUp(self):
self.util = OpTestUtil(OpTestConfiguration.conf)
self.c = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
self.distro = self.util.distro_name()
self.k_version = "".join(self.cv_HOST.host_run_command("uname -r"))

def runTest(self):
'''
Expand Down Expand Up @@ -102,8 +101,7 @@ def runTest(self):
Running the test
'''
self.c = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
self.k_version = "".join(self.cv_HOST.host_run_command("uname -r"))
src_path = f'/root/kernel-{self.k_version}*/linux-{self.k_version}*'
src_path = f'/root/kernel/linux'
self.cv_HOST.host_run_command(f"cd {src_path}")
src_path = "".join(self.cv_HOST.host_run_command("pwd"))
temp_dir = tempfile.mkdtemp(prefix="Lcov_result_")
Expand Down

0 comments on commit b976629

Please sign in to comment.