Commit 7b35436a authored by Brenden Blanco's avatar Brenden Blanco

Fix long running test_debuginfo and python3 fix

Make sure subclass calls super().tearDown to clean up dummy process.
Also, fixup a python3 str.encode().

Fixes: #1013
Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
parent 3febfa49
...@@ -71,7 +71,8 @@ class SymbolCache(object): ...@@ -71,7 +71,8 @@ class SymbolCache(object):
def resolve_name(self, module, name): def resolve_name(self, module, name):
addr = ct.c_ulonglong() addr = ct.c_ulonglong()
if lib.bcc_symcache_resolve_name( if lib.bcc_symcache_resolve_name(
self.cache, module, name, ct.pointer(addr)) < 0: self.cache, module.encode("ascii"),
name.encode("ascii"), ct.pointer(addr)) < 0:
return -1 return -1
return addr.value return addr.value
......
...@@ -22,6 +22,7 @@ class Harness(TestCase): ...@@ -22,6 +22,7 @@ class Harness(TestCase):
def tearDown(self): def tearDown(self):
self.process.kill() self.process.kill()
self.process.wait()
def resolve_addr(self): def resolve_addr(self):
sym, offset, module = self.syms.resolve(self.addr) sym, offset, module = self.syms.resolve(self.addr)
...@@ -45,6 +46,7 @@ class TestDebuglink(Harness): ...@@ -45,6 +46,7 @@ class TestDebuglink(Harness):
.split()) .split())
def tearDown(self): def tearDown(self):
super(TestDebuglink, self).tearDown()
subprocess.check_output('rm dummy dummy.debug'.split()) subprocess.check_output('rm dummy dummy.debug'.split())
def test_resolve_addr(self): def test_resolve_addr(self):
...@@ -65,6 +67,7 @@ class TestBuildid(Harness): ...@@ -65,6 +67,7 @@ class TestBuildid(Harness):
'/12/3456789abcdef0123456789abcdef012345678.debug').split()) '/12/3456789abcdef0123456789abcdef012345678.debug').split())
def tearDown(self): def tearDown(self):
super(TestBuildid, self).tearDown()
subprocess.check_output('rm dummy'.split()) subprocess.check_output('rm dummy'.split())
subprocess.check_output(('rm /usr/lib/debug/.build-id/12' + subprocess.check_output(('rm /usr/lib/debug/.build-id/12' +
'/3456789abcdef0123456789abcdef012345678.debug').split()) '/3456789abcdef0123456789abcdef012345678.debug').split())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment