示例#1
0
 def test_global_osprofile(self, p):
     set_cwd(tempfile.mkdtemp())
     cuckoo_create(cfg={
         "memory": {
             "basic": {
                 "guest_profile": "profile0",
             },
         },
     })
     filepath = Files.temp_named_put("notempty", "memory.dmp")
     m = Memory()
     m.set_path(os.path.dirname(filepath))
     m.set_machine({})
     m.run()
     p.assert_called_once_with(filepath, "profile0")
示例#2
0
 def test_invalid_mempath(self, p):
     set_cwd(tempfile.mkdtemp())
     m = Memory()
     m.memory_path = "notafile"
     assert m.run() is None
     p.error.assert_called_once()
     assert "dump not found" in p.error.call_args_list[0][0][0]
示例#3
0
 def test_empty_mempath(self, p):
     set_cwd(tempfile.mkdtemp())
     m = Memory()
     m.memory_path = Files.temp_put("")
     assert m.run() is None
     p.error.assert_called_once()
     assert "dump empty" in p.error.call_args_list[0][0][0]
示例#4
0
 def test_no_mempath(self, p):
     set_cwd(self.mkdtemp())
     m = Memory()
     m.memory_path = None
     assert m.run() is None
     p.error.assert_called_once()
     assert "dump not found" in p.error.call_args_list[0][0][0]