MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / test_ELF

Method test_ELF

contrib/devtools/test-security-check.py:29–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27
28class TestSecurityChecks(unittest.TestCase):
29 def test_ELF(self):
30 source = 'test1.c'
31 executable = 'test1'
32 cc = 'gcc'
33 write_testcode(source)
34
35 self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE']),
36 (1, executable+': failed PIE NX RELRO Canary'))
37 self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE']),
38 (1, executable+': failed PIE RELRO Canary'))
39 self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-no-pie','-fno-PIE']),
40 (1, executable+': failed PIE RELRO'))
41 self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE']),
42 (1, executable+': failed RELRO'))
43 self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE']),
44 (0, ''))
45
46 def test_32bit_PE(self):
47 source = 'test1.c'

Callers

nothing calls this directly

Calls 2

write_testcodeFunction · 0.85
call_security_checkFunction · 0.85

Tested by

no test coverage detected