示例#1
0
 def test_func_which(self):
     res = gdb_test_python_method("which('gdb')")
     lines = res.splitlines()
     self.assertIn("/gdb", lines[-1])
     res = gdb_test_python_method("which('__IDontExist__')")
     self.assertIn("Missing file `__IDontExist__`", res)
     return
示例#2
0
 def test_func_which(self):
     res = gdb_test_python_method("which('gdb')")
     lines = res.splitlines()
     self.assertIn("/gdb", lines[-1])
     res = gdb_test_python_method("which('__IDontExist__')")
     self.assertIn("Missing file `__IDontExist__`", res)
     return
示例#3
0
 def test_function_which(self):
     res = gdb_test_python_method("which('gdb')")
     lines = res.splitlines()
     self.assertTrue(b"/gdb" in lines[-1])
     res = gdb_test_python_method("which('__IDontExist__')")
     self.assertTrue(b"Missing file `__IDontExist__`" in res)
     return
示例#4
0
 def test_function_which(self):
     res = gdb_test_python_method("which('gdb')")
     lines = res.splitlines()
     self.assertTrue(b"/gdb" in lines[-1])
     res = gdb_test_python_method("which('__IDontExist__')")
     self.assertTrue(b"Missing file `__IDontExist__`" in res)
     return
示例#5
0
 def test_func_get_filepath(self):
     res = gdb_test_python_method("get_filepath()", target="/bin/ls")
     self.assertNoException(res)
     subprocess.call(["cp", "/bin/ls", "/tmp/foo bar"])
     res = gdb_test_python_method("get_filepath()", target="/tmp/foo bar")
     self.assertNoException(res)
     subprocess.call(["rm", "/tmp/foo bar"])
     return
示例#6
0
 def test_func_get_filepath(self):
     res = gdb_test_python_method("get_filepath()", target="/bin/ls")
     self.assertNoException(res)
     subprocess.call(["cp", "/bin/ls", "/tmp/foo bar"])
     res = gdb_test_python_method("get_filepath()", target="/tmp/foo bar")
     self.assertNoException(res)
     subprocess.call(["rm", "/tmp/foo bar"])
     return
示例#7
0
 def test_func_get_pid(self):
     res = gdb_test_python_method("get_pid()", target="/bin/ls")
     self.assertNoException(res)
     self.assertTrue(int(res.splitlines()[-1]))
     return
示例#8
0
 def test_func_set_arch(self):
     res = gdb_test_python_method("current_arch.arch, current_arch.mode",
                                  before="set_arch()")
     res = (res.splitlines()[-1])
     self.assertIn("X86", res)
     return
示例#9
0
 def test_func_get_memory_alignment(self):
     res = gdb_test_python_method("get_memory_alignment(in_bits=False)")
     self.assertIn(res.splitlines()[-1], ("4", "8"))
     return
示例#10
0
 def test_function_get_memory_alignment(self):
     res = gdb_test_python_method("get_memory_alignment(in_bits=False)")
     self.assertTrue(res.splitlines()[-1] in (b"4", b"8"))
     return
示例#11
0
 def test_func_get_pid(self):
     res = gdb_test_python_method("get_pid()", target="/bin/ls")
     self.assertNoException(res)
     self.assertTrue(int(res.splitlines()[-1]))
     return
示例#12
0
 def test_func_set_arch(self):
     res = gdb_test_python_method("current_arch.arch, current_arch.mode", before="set_arch()")
     res = (res.splitlines()[-1])
     self.assertIn("X86", res)
     return
示例#13
0
 def test_func_get_memory_alignment(self):
     res = gdb_test_python_method("get_memory_alignment(in_bits=False)")
     self.assertIn(res.splitlines()[-1], ("4", "8"))
     return
示例#14
0
 def test_function_get_memory_alignment(self):
     res = gdb_test_python_method("get_memory_alignment(in_bits=False)")
     self.assertTrue(res.splitlines()[-1] in (b"4", b"8"))
     return