MCPcopy Create free account
hub / github.com/OWASP/Python-Honeypot / TestCoreGetModules

Class TestCoreGetModules

tests/test_core_get_modules.py:9–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class TestCoreGetModules(unittest.TestCase):
10
11 def test_virtual_machine_container_names(self):
12 modules_list = load_all_modules()
13 config = honeypot_configuration_builder(modules_list)
14 container_names = virtual_machine_names_to_container_names(config)
15 # list of all modules available
16 all_modules = [
17 'ohp_ftpserver_weak_password',
18 'ohp_ftpserver_strong_password',
19 'ohp_icsserver_veeder_root_guardian_ast',
20 'ohp_sshserver_weak_password',
21 'ohp_sshserver_strong_password',
22 'ohp_smtpserver_strong_password',
23 'ohp_httpserver_basic_auth_strong_password',
24 'ohp_httpserver_basic_auth_weak_password'
25 ]
26 self.assertCountEqual(container_names, all_modules)
27
28 def test_load_all_modules(self):
29 """
30 checking total number of modules
31 """
32 modules_list = load_all_modules()
33 self.assertEqual(len(modules_list), 8)
34
35 def test_vm_to_container_name(self):
36 vm_name = "ohp_sshserver"
37 module_name = "ssh/weak_password"
38 container_name = virtual_machine_name_to_container_name(vm_name, module_name)
39 self.assertEqual(container_name, "ohp_sshserver_weak_password")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected