예제 #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
파일: test-runner.py 프로젝트: Sinkmanu/gef
 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
파일: test-runner.py 프로젝트: Sinkmanu/gef
 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