MCPcopy Create free account
hub / github.com/qilingframework/qiling / test_elf_linux_cloexec_x8664

Method test_elf_linux_cloexec_x8664

tests/test_elf_multithread.py:48–68  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46 self.assertEqual('child', ql.loader.argv[0])
47
48 def test_elf_linux_cloexec_x8664(self):
49 ql = Qiling([fr'{X64_LINUX_ROOTFS}/bin/x8664_cloexec_test'], X64_LINUX_ROOTFS, multithread=True, verbose=QL_VERBOSE.DEBUG)
50
51 filename = 'stderr.txt'
52 err = ql_file.open(filename, os.O_RDWR | os.O_CREAT, 0o644)
53
54 ql.os.stats = QlOsNullStats()
55 ql.os.stderr = err
56
57 ql.run()
58 err.close()
59
60 with open(filename, 'r') as f:
61 contents = f.readlines()
62
63 # cleanup
64 os.remove(filename)
65
66 self.assertGreaterEqual(len(contents), 4)
67 self.assertIn('Bad file descriptor', contents[-2])
68 self.assertIn('Bad file descriptor', contents[-1])
69
70 def test_multithread_elf_linux_x86(self):
71 logged: List[str] = []

Callers

nothing calls this directly

Calls 6

runMethod · 0.95
QilingClass · 0.90
QlOsNullStatsClass · 0.90
openMethod · 0.45
closeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected