MCPcopy
hub / github.com/apache/caldera / setup_planning_test

Function setup_planning_test

tests/services/test_planning_svc.py:74–98  ·  view source on GitHub ↗
(executor, ability, agent, operation, data_svc, event_svc, init_base_world)

Source from the content-addressed store, hash-verified

72
73@pytest.fixture
74async def setup_planning_test(executor, ability, agent, operation, data_svc, event_svc, init_base_world):
75 texecutor = executor(name='sh', platform='darwin', command='mkdir test', cleanup='rm -rf test')
76 tability = ability(ability_id='123', executors=[texecutor], repeatable=True, buckets=['test'], name='test1')
77 tagent = agent(sleep_min=1, sleep_max=2, watchdog=0, executors=['sh'], platform='darwin',
78 server='http://127.0.0.1:8000')
79 tsource = Source(id='123', name='test', facts=[], adjustments=[])
80 toperation = operation(name='test1', agents=[tagent],
81 adversary=Adversary(name='test', description='test',
82 atomic_ordering=[],
83 adversary_id='XYZ'),
84 source=tsource)
85
86 cexecutor = executor(name='sh', platform='darwin', command=test_string, cleanup='whoami')
87 cability = ability(ability_id='321', executors=[cexecutor], singleton=True, name='test2')
88
89 await data_svc.store(tability)
90 await data_svc.store(cability)
91
92 await data_svc.store(
93 Obfuscator(name='plain-text',
94 description='Does no obfuscation to any command, instead running it in plain text',
95 module='plugins.stockpile.app.obfuscators.plain_text')
96 )
97
98 yield tability, tagent, toperation, cability
99
100
101@pytest.fixture(params=stop_bucket_exhaustion_params)

Callers

nothing calls this directly

Calls 8

SourceClass · 0.90
AdversaryClass · 0.90
ObfuscatorClass · 0.90
executorFunction · 0.85
abilityFunction · 0.85
agentFunction · 0.85
operationFunction · 0.85
storeMethod · 0.45

Tested by

no test coverage detected