예제 #1
0
 def test_default_cwd(self, p):
     set_cwd(tempfile.mkdtemp())
     cuckoo_create()
     with chdir(cwd()):
         decide_cwd(".")
         cuckoo_init(logging.INFO, self.ctx)
         p.assert_called_once_with("cuckoo community")
예제 #2
0
 def test_has_signatures(self, p):
     set_cwd(tempfile.mkdtemp())
     sys.modules.pop("signatures", None)
     sys.modules.pop("signatures.android", None)
     sys.modules.pop("signatures.cross", None)
     sys.modules.pop("signatures.darwin", None)
     sys.modules.pop("signatures.extractor", None)
     sys.modules.pop("signatures.network", None)
     sys.modules.pop("signatures.windows", None)
     cuckoo_create()
     shutil.copy(
         "tests/files/enumplugins/sig1.py",
         cwd("signatures", "windows", "foobar.py")
     )
     cuckoo.signatures = []
     cuckoo_init(logging.INFO, self.ctx)
     p.assert_not_called()
예제 #3
0
 def test_hardcoded_cwd_with_quote(self, p):
     set_cwd(tempfile.mkdtemp("foo ' bar"))
     cuckoo_create()
     decide_cwd(cwd())
     cuckoo_init(logging.INFO, self.ctx)
     p.assert_called_once_with('cuckoo --cwd "%s" community' % cwd())
예제 #4
0
 def test_hardcoded_cwd(self, p):
     set_cwd(tempfile.mkdtemp())
     cuckoo_create()
     decide_cwd(cwd())
     cuckoo_init(logging.INFO, self.ctx)
     p.assert_called_once_with("cuckoo --cwd %s community" % cwd())
예제 #5
0
 def test_hardcoded_cwd_with_quote(self, p):
     set_cwd(tempfile.mkdtemp("foo ' bar"))
     cuckoo_create()
     decide_cwd(cwd())
     cuckoo_init(logging.INFO, self.ctx)
     p.assert_called_once_with('cuckoo --cwd "%s" community' % cwd())
예제 #6
0
 def test_hardcoded_cwd(self, p):
     set_cwd(tempfile.mkdtemp())
     cuckoo_create()
     decide_cwd(cwd())
     cuckoo_init(logging.INFO, self.ctx)
     p.assert_called_once_with("cuckoo --cwd %s community" % cwd())