Skip to content

Commit

Permalink
Merge pull request #428 from perillo/fix-out-directory-is-executable-…
Browse files Browse the repository at this point in the history
…test

tests: fix basic.OutDirectoryIsExecutable
  • Loading branch information
SimonKagstrom authored Mar 17, 2024
2 parents 17db4f0 + 402b735 commit 0f07787
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/python/short-test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/python
#!/usr/bin/env python3

import sys

def doSomething():
print 'Hello world'
print('Hello world')


if __name__ == '__main__':
Expand Down
6 changes: 5 additions & 1 deletion tests/tools/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def runTest(self):
class OutDirectoryIsExecutable(testbase.KcovTestCase):
def runTest(self):
self.setUp()
rv,o = self.do(testbase.kcov + " echo python -V")
# Running a system executable on Linux may cause ptrace to fails with
# "Operation not permitted", even with ptrace_scope set to 0.
# See https://www.kernel.org/doc/Documentation/security/Yama.txt
executable = testbase.sources + "/tests/python/short-test.py"
rv,o = self.do(testbase.kcov + " echo " + executable)

assert rv == 0

0 comments on commit 0f07787

Please sign in to comment.