forked from p15670423/monkey
Moved init of mappings to init file
This commit is contained in:
parent
db58bf9a87
commit
3f85c336b9
|
@ -0,0 +1,2 @@
|
||||||
|
from zero_trust_consts import populate_mappings
|
||||||
|
populate_mappings()
|
|
@ -128,6 +128,11 @@ TESTS_MAP = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EVENT_TYPE_ISLAND = "island"
|
||||||
|
EVENT_TYPE_MONKEY_NETWORK = "monkey_network"
|
||||||
|
EVENT_TYPE_MONKEY_LOCAL = "monkey_local"
|
||||||
|
EVENT_TYPES = (EVENT_TYPE_MONKEY_LOCAL, EVENT_TYPE_MONKEY_NETWORK, EVENT_TYPE_ISLAND)
|
||||||
|
|
||||||
PILLARS_TO_TESTS = {
|
PILLARS_TO_TESTS = {
|
||||||
DATA: [],
|
DATA: [],
|
||||||
PEOPLE: [],
|
PEOPLE: [],
|
||||||
|
@ -138,6 +143,16 @@ PILLARS_TO_TESTS = {
|
||||||
AUTOMATION_ORCHESTRATION: []
|
AUTOMATION_ORCHESTRATION: []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DIRECTIVES_TO_TESTS = {}
|
||||||
|
|
||||||
|
DIRECTIVES_TO_PILLARS = {}
|
||||||
|
|
||||||
|
|
||||||
|
def populate_mappings():
|
||||||
|
populate_pillars_to_tests()
|
||||||
|
populate_directives_to_tests()
|
||||||
|
populate_directives_to_pillars()
|
||||||
|
|
||||||
|
|
||||||
def populate_pillars_to_tests():
|
def populate_pillars_to_tests():
|
||||||
for pillar in PILLARS:
|
for pillar in PILLARS:
|
||||||
|
@ -146,11 +161,6 @@ def populate_pillars_to_tests():
|
||||||
PILLARS_TO_TESTS[pillar].append(test)
|
PILLARS_TO_TESTS[pillar].append(test)
|
||||||
|
|
||||||
|
|
||||||
populate_pillars_to_tests()
|
|
||||||
|
|
||||||
DIRECTIVES_TO_TESTS = {}
|
|
||||||
|
|
||||||
|
|
||||||
def populate_directives_to_tests():
|
def populate_directives_to_tests():
|
||||||
for single_directive in DIRECTIVES:
|
for single_directive in DIRECTIVES:
|
||||||
DIRECTIVES_TO_TESTS[single_directive] = []
|
DIRECTIVES_TO_TESTS[single_directive] = []
|
||||||
|
@ -158,11 +168,6 @@ def populate_directives_to_tests():
|
||||||
DIRECTIVES_TO_TESTS[test_info[DIRECTIVE_KEY]].append(test)
|
DIRECTIVES_TO_TESTS[test_info[DIRECTIVE_KEY]].append(test)
|
||||||
|
|
||||||
|
|
||||||
populate_directives_to_tests()
|
|
||||||
|
|
||||||
DIRECTIVES_TO_PILLARS = {}
|
|
||||||
|
|
||||||
|
|
||||||
def populate_directives_to_pillars():
|
def populate_directives_to_pillars():
|
||||||
for directive, directive_tests in DIRECTIVES_TO_TESTS.items():
|
for directive, directive_tests in DIRECTIVES_TO_TESTS.items():
|
||||||
directive_pillars = set()
|
directive_pillars = set()
|
||||||
|
@ -170,11 +175,3 @@ def populate_directives_to_pillars():
|
||||||
for pillar in TESTS_MAP[test][PILLARS_KEY]:
|
for pillar in TESTS_MAP[test][PILLARS_KEY]:
|
||||||
directive_pillars.add(pillar)
|
directive_pillars.add(pillar)
|
||||||
DIRECTIVES_TO_PILLARS[directive] = directive_pillars
|
DIRECTIVES_TO_PILLARS[directive] = directive_pillars
|
||||||
|
|
||||||
|
|
||||||
populate_directives_to_pillars()
|
|
||||||
|
|
||||||
EVENT_TYPE_ISLAND = "island"
|
|
||||||
EVENT_TYPE_MONKEY_NETWORK = "monkey_network"
|
|
||||||
EVENT_TYPE_MONKEY_LOCAL = "monkey_local"
|
|
||||||
EVENT_TYPES = (EVENT_TYPE_MONKEY_LOCAL, EVENT_TYPE_MONKEY_NETWORK, EVENT_TYPE_ISLAND)
|
|
||||||
|
|
Loading…
Reference in New Issue