Skip to content

Commit 8ac63bc

Browse files
committed
join threads
1 parent 02f121b commit 8ac63bc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_tendaac15_httpd.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class ELFTest(unittest.TestCase):
3232

3333
def test_tenda_ac15_arm(self):
34-
34+
stop = False
3535
def nvram_listener():
3636
server_address = '../examples/rootfs/arm_tendaac15/var/cfm_socket'
3737

@@ -63,6 +63,7 @@ def nvram_listener():
6363
data.clear()
6464
finally:
6565
connection.close()
66+
break
6667

6768
def patcher(ql: Qiling):
6869
br0_addr = ql.mem.search(b'br0\x00')
@@ -74,7 +75,8 @@ def my_tenda():
7475
ql = Qiling(["../examples/rootfs/arm_tendaac15/bin/httpd"], "../examples/rootfs/arm_tendaac15", verbose=QL_VERBOSE.DEBUG)
7576
ql.add_fs_mapper("/dev/urandom", "/dev/urandom")
7677
ql.hook_address(patcher, ql.loader.elf_entry)
77-
ql.run()
78+
while not stop:
79+
ql.run(count=5000)
7880

7981
if __name__ == "__main__":
8082
threads = [
@@ -103,7 +105,9 @@ def my_tenda():
103105
response = conn.getresponse()
104106

105107
self.assertIn(b"Please update your documents to reflect the new location.", response.read())
106-
108+
stop = True
109+
for th in threads:
110+
th.join()
107111

108112
if __name__ == "__main__":
109113
unittest.main()

0 commit comments

Comments
 (0)