Skip to content

Commit

Permalink
Merge pull request #459 from libhe/master
Browse files Browse the repository at this point in the history
run rogue.sh for cvn env.
  • Loading branch information
libhe authored Oct 24, 2024
2 parents 68e76b1 + 6952a63 commit fbef217
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions os_tests/tests/test_rhel_guest_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,22 @@ def test_check_files_controlled_by_rpm(self):
dest_path = '/tmp/' + utils_script
self.SSH.put_file(local_file=src_path, rmt_file=dest_path)
utils_lib.is_pkg_installed(self,"python3")
cmd = "sudo python3 %s" % dest_path
output = utils_lib.run_cmd(self,
cmd = "which python3"
ret = utils_lib.run_cmd(self, cmd, expect_ret=0, msg="Check if python3 exist")
if ret:
cmd = "sudo python3 %s" % dest_path
output = utils_lib.run_cmd(self,
cmd,
expect_ret=0,
timeout=1200,
msg="run rogue.py")

else:
cmd = "sudo sh -c 'chmod 755 %s && %s'" % (dest_path, dest_path)
output = utils_lib.run_cmd(self,
cmd,
expect_ret=0,
timeout=600,
msg="run rogue.sh")
cmd = "test -f /tmp/rogue && echo 'File exists' || echo 'File does not exist'"
output = utils_lib.run_cmd(self, cmd, expect_ret=0, msg="Check if /tmp/rogue exists")
self.assertEqual(output.strip(), 'File exists', "rogue.py failed to create /tmp/rogue")
Expand Down

0 comments on commit fbef217

Please sign in to comment.