Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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