Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
jcanseco committed Apr 16, 2018
1 parent e9e4e65 commit 8917d1b
Showing 1 changed file with 53 additions and 39 deletions.
92 changes: 53 additions & 39 deletions tests/python/test_tools_on_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@

class RemoteTests(TestCase, ToolTestRunner):

def list_files(self, startpath):
for root, dirs, files in os.walk(startpath):
level = root.replace(startpath, '').count(os.sep)
indent = ' ' * 4 * (level)
print('{}{}/'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
for f in files:
print('{}{}'.format(subindent, f))

def setUp(self):
self.list_files("../../")

self.original_env = os.environ.copy()

os.environ["ARCH"] = "x86"
Expand All @@ -28,57 +39,60 @@ def tearDown(self):

os.remove(BPFD_INSTALL_PATH)

def test_biolatency(self):
self.run_with_duration("biolatency.py 1 1")
def test_dir(self):
print("Done.")

# def test_biolatency(self):
# self.run_with_duration("biolatency.py 1 1")

@skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4")
def test_biosnoop(self):
self.run_with_int("biosnoop.py")
# @skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4")
# def test_biosnoop(self):
# self.run_with_int("biosnoop.py")

def test_biotop(self):
self.run_with_duration("biotop.py 1 1")
# def test_biotop(self):
# self.run_with_duration("biotop.py 1 1")

def test_cachestat(self):
self.run_with_duration("cachestat.py 1 1")
# def test_cachestat(self):
# self.run_with_duration("cachestat.py 1 1")

def test_filetop(self):
self.run_with_duration("filetop.py 1 1")
# def test_filetop(self):
# self.run_with_duration("filetop.py 1 1")

def test_hardirqs(self):
self.run_with_duration("hardirqs.py 1 1")
# def test_hardirqs(self):
# self.run_with_duration("hardirqs.py 1 1")

@skipUnless(kernel_version_ge(4,6), "requires kernel >= 4.6")
def test_offcputime(self):
self.run_with_duration("offcputime.py 1")
# @skipUnless(kernel_version_ge(4,6), "requires kernel >= 4.6")
# def test_offcputime(self):
# self.run_with_duration("offcputime.py 1")

@skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4")
def test_opensnoop(self):
self.run_with_int("opensnoop.py")
# @skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4")
# def test_opensnoop(self):
# self.run_with_int("opensnoop.py")

@skipUnless(kernel_version_ge(4,9), "requires kernel >= 4.9")
def test_profile(self):
# When running profile.py on a remote target, it takes much longer
# to output results (i.e. not instantaneous). This makes using
# run_with_duration() unsuitable for this test since it'll erroneously
# conclude that profile.py has hanged when it is just taking some time
# to print its output.
self.run_with_int("profile.py 1")
# @skipUnless(kernel_version_ge(4,9), "requires kernel >= 4.9")
# def test_profile(self):
# # When running profile.py on a remote target, it takes much longer
# # to output results (i.e. not instantaneous). This makes using
# # run_with_duration() unsuitable for this test since it'll erroneously
# # conclude that profile.py has hanged when it is just taking some time
# # to print its output.
# self.run_with_int("profile.py 1")

@skipUnless(kernel_version_ge(4,9), "requires kernel >= 4.9")
def test_runqlen(self):
self.run_with_duration("runqlen.py 1 1")
# @skipUnless(kernel_version_ge(4,9), "requires kernel >= 4.9")
# def test_runqlen(self):
# self.run_with_duration("runqlen.py 1 1")

@skipUnless(kernel_version_ge(4,6), "requires kernel >= 4.6")
def test_stackcount(self):
self.run_with_int("stackcount.py __kmalloc -i 1")
# @skipUnless(kernel_version_ge(4,6), "requires kernel >= 4.6")
# def test_stackcount(self):
# self.run_with_int("stackcount.py __kmalloc -i 1")

@skipUnless(kernel_version_ge(4,7), "requires kernel >= 4.7")
def test_syscount(self):
self.run_with_int("syscount.py -i 1")
# @skipUnless(kernel_version_ge(4,7), "requires kernel >= 4.7")
# def test_syscount(self):
# self.run_with_int("syscount.py -i 1")

@skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4")
def test_trace(self):
self.run_with_int("trace.py SyS_open")
# @skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4")
# def test_trace(self):
# self.run_with_int("trace.py SyS_open")

if __name__ == "__main__":
main()

0 comments on commit 8917d1b

Please sign in to comment.