synapse 2.154.1__py311-none-any.whl → 2.156.0__py311-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of synapse might be problematic. Click here for more details.
- synapse/cmds/cortex.py +2 -14
- synapse/common.py +13 -36
- synapse/cortex.py +15 -508
- synapse/lib/ast.py +215 -22
- synapse/lib/cell.py +35 -8
- synapse/lib/certdir.py +11 -0
- synapse/lib/cmdr.py +0 -5
- synapse/lib/gis.py +2 -2
- synapse/lib/httpapi.py +14 -43
- synapse/lib/layer.py +64 -201
- synapse/lib/lmdbslab.py +11 -0
- synapse/lib/node.py +1 -3
- synapse/lib/parser.py +10 -0
- synapse/lib/slabseqn.py +2 -1
- synapse/lib/snap.py +121 -21
- synapse/lib/spooled.py +9 -0
- synapse/lib/storm.lark +23 -6
- synapse/lib/storm.py +16 -339
- synapse/lib/storm_format.py +5 -0
- synapse/lib/stormhttp.py +10 -1
- synapse/lib/stormlib/gen.py +1 -2
- synapse/lib/stormlib/gis.py +41 -0
- synapse/lib/stormlib/graph.py +2 -1
- synapse/lib/stormlib/stats.py +21 -2
- synapse/lib/stormlib/storm.py +16 -1
- synapse/lib/stormtypes.py +244 -16
- synapse/lib/types.py +16 -2
- synapse/lib/version.py +2 -2
- synapse/lib/view.py +118 -25
- synapse/models/base.py +2 -2
- synapse/models/inet.py +60 -30
- synapse/models/infotech.py +130 -8
- synapse/models/orgs.py +3 -0
- synapse/models/proj.py +3 -0
- synapse/models/risk.py +24 -6
- synapse/models/syn.py +0 -38
- synapse/tests/test_cmds_cortex.py +1 -1
- synapse/tests/test_cortex.py +70 -338
- synapse/tests/test_lib_agenda.py +19 -54
- synapse/tests/test_lib_aha.py +97 -0
- synapse/tests/test_lib_ast.py +596 -0
- synapse/tests/test_lib_grammar.py +30 -10
- synapse/tests/test_lib_httpapi.py +33 -49
- synapse/tests/test_lib_layer.py +19 -234
- synapse/tests/test_lib_lmdbslab.py +22 -0
- synapse/tests/test_lib_snap.py +9 -0
- synapse/tests/test_lib_spooled.py +4 -0
- synapse/tests/test_lib_storm.py +16 -309
- synapse/tests/test_lib_stormlib_gis.py +21 -0
- synapse/tests/test_lib_stormlib_stats.py +107 -20
- synapse/tests/test_lib_stormlib_storm.py +25 -0
- synapse/tests/test_lib_stormtypes.py +253 -8
- synapse/tests/test_lib_types.py +40 -0
- synapse/tests/test_lib_view.py +6 -13
- synapse/tests/test_model_base.py +1 -1
- synapse/tests/test_model_inet.py +15 -0
- synapse/tests/test_model_infotech.py +110 -0
- synapse/tests/test_model_orgs.py +10 -0
- synapse/tests/test_model_person.py +0 -3
- synapse/tests/test_model_proj.py +2 -1
- synapse/tests/test_model_risk.py +24 -0
- synapse/tests/test_model_syn.py +20 -34
- synapse/tests/test_tools_csvtool.py +2 -1
- synapse/tests/test_tools_feed.py +4 -30
- synapse/tools/csvtool.py +2 -1
- {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/METADATA +9 -9
- {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/RECORD +70 -72
- {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/WHEEL +1 -1
- synapse/cmds/cron.py +0 -726
- synapse/cmds/trigger.py +0 -319
- synapse/tests/test_cmds_cron.py +0 -453
- synapse/tests/test_cmds_trigger.py +0 -176
- {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/LICENSE +0 -0
- {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/top_level.txt +0 -0
synapse/tests/test_lib_aha.py
CHANGED
|
@@ -1115,3 +1115,100 @@ class AhaTest(s_test.SynTest):
|
|
|
1115
1115
|
online = svcinfo.get('online')
|
|
1116
1116
|
self.nn(online)
|
|
1117
1117
|
self.true(ready)
|
|
1118
|
+
|
|
1119
|
+
async def test_aha_reprovision(self):
|
|
1120
|
+
with self.withNexusReplay() as stack:
|
|
1121
|
+
with self.getTestDir() as dirn:
|
|
1122
|
+
aha00dirn = s_common.gendir(dirn, 'aha00')
|
|
1123
|
+
aha01dirn = s_common.gendir(dirn, 'aha01')
|
|
1124
|
+
svc0dirn = s_common.gendir(dirn, 'svc00')
|
|
1125
|
+
svc1dirn = s_common.gendir(dirn, 'svc01')
|
|
1126
|
+
async with await s_base.Base.anit() as cm:
|
|
1127
|
+
aconf = {
|
|
1128
|
+
'aha:name': 'aha',
|
|
1129
|
+
'aha:network': 'loop.vertex.link',
|
|
1130
|
+
'provision:listen': 'ssl://aha.loop.vertex.link:0'
|
|
1131
|
+
}
|
|
1132
|
+
name = aconf.get('aha:name')
|
|
1133
|
+
netw = aconf.get('aha:network')
|
|
1134
|
+
dnsname = f'{name}.{netw}'
|
|
1135
|
+
|
|
1136
|
+
aha = await s_aha.AhaCell.anit(aha00dirn, conf=aconf)
|
|
1137
|
+
await cm.enter_context(aha)
|
|
1138
|
+
|
|
1139
|
+
addr, port = aha.provdmon.addr
|
|
1140
|
+
# update the config to reflect the dynamically bound port
|
|
1141
|
+
aha.conf['provision:listen'] = f'ssl://{dnsname}:{port}'
|
|
1142
|
+
|
|
1143
|
+
# do this config ex-post-facto due to port binding...
|
|
1144
|
+
host, ahaport = await aha.dmon.listen(f'ssl://0.0.0.0:0?hostname={dnsname}&ca={netw}')
|
|
1145
|
+
aha.conf['aha:urls'] = (f'ssl://{dnsname}:{ahaport}',)
|
|
1146
|
+
|
|
1147
|
+
onetime = await aha.addAhaSvcProv('00.svc', provinfo=None)
|
|
1148
|
+
sconf = {'aha:provision': onetime}
|
|
1149
|
+
s_common.yamlsave(sconf, svc0dirn, 'cell.yaml')
|
|
1150
|
+
svc0 = await s_cell.Cell.anit(svc0dirn, conf=sconf)
|
|
1151
|
+
await cm.enter_context(svc0)
|
|
1152
|
+
|
|
1153
|
+
onetime = await aha.addAhaSvcProv('01.svc', provinfo={'mirror': 'svc'})
|
|
1154
|
+
sconf = {'aha:provision': onetime}
|
|
1155
|
+
s_common.yamlsave(sconf, svc1dirn, 'cell.yaml')
|
|
1156
|
+
svc1 = await s_cell.Cell.anit(svc1dirn, conf=sconf)
|
|
1157
|
+
await cm.enter_context(svc1)
|
|
1158
|
+
|
|
1159
|
+
# Ensure that services have connected
|
|
1160
|
+
await asyncio.wait_for(svc1.nexsroot._mirready.wait(), timeout=6)
|
|
1161
|
+
await svc1.sync()
|
|
1162
|
+
|
|
1163
|
+
# Get Aha services
|
|
1164
|
+
snfo = await aha.getAhaSvc('01.svc.loop.vertex.link')
|
|
1165
|
+
svcinfo = snfo.get('svcinfo')
|
|
1166
|
+
ready = svcinfo.get('ready')
|
|
1167
|
+
self.true(ready)
|
|
1168
|
+
|
|
1169
|
+
await aha.fini()
|
|
1170
|
+
|
|
1171
|
+
# Now re-deploy the AHA Service and re-provision the two cells
|
|
1172
|
+
# with the same AHA configuration
|
|
1173
|
+
async with await s_base.Base.anit() as cm:
|
|
1174
|
+
aconf = {
|
|
1175
|
+
'aha:name': 'aha',
|
|
1176
|
+
'aha:network': 'loop.vertex.link',
|
|
1177
|
+
'provision:listen': 'ssl://aha.loop.vertex.link:0'
|
|
1178
|
+
}
|
|
1179
|
+
name = aconf.get('aha:name')
|
|
1180
|
+
netw = aconf.get('aha:network')
|
|
1181
|
+
dnsname = f'{name}.{netw}'
|
|
1182
|
+
|
|
1183
|
+
aha = await s_aha.AhaCell.anit(aha01dirn, conf=aconf)
|
|
1184
|
+
await cm.enter_context(aha)
|
|
1185
|
+
|
|
1186
|
+
addr, port = aha.provdmon.addr
|
|
1187
|
+
# update the config to reflect the dynamically bound port
|
|
1188
|
+
aha.conf['provision:listen'] = f'ssl://{dnsname}:{port}'
|
|
1189
|
+
|
|
1190
|
+
# do this config ex-post-facto due to port binding...
|
|
1191
|
+
host, ahaport = await aha.dmon.listen(f'ssl://0.0.0.0:0?hostname={dnsname}&ca={netw}')
|
|
1192
|
+
aha.conf['aha:urls'] = (f'ssl://{dnsname}:{ahaport}',)
|
|
1193
|
+
|
|
1194
|
+
onetime = await aha.addAhaSvcProv('00.svc', provinfo=None)
|
|
1195
|
+
sconf = {'aha:provision': onetime}
|
|
1196
|
+
s_common.yamlsave(sconf, svc0dirn, 'cell.yaml')
|
|
1197
|
+
svc0 = await s_cell.Cell.anit(svc0dirn, conf=sconf)
|
|
1198
|
+
await cm.enter_context(svc0)
|
|
1199
|
+
|
|
1200
|
+
onetime = await aha.addAhaSvcProv('01.svc', provinfo={'mirror': 'svc'})
|
|
1201
|
+
sconf = {'aha:provision': onetime}
|
|
1202
|
+
s_common.yamlsave(sconf, svc1dirn, 'cell.yaml')
|
|
1203
|
+
svc1 = await s_cell.Cell.anit(svc1dirn, conf=sconf)
|
|
1204
|
+
await cm.enter_context(svc1)
|
|
1205
|
+
|
|
1206
|
+
# Ensure that services have connected
|
|
1207
|
+
await asyncio.wait_for(svc1.nexsroot._mirready.wait(), timeout=6)
|
|
1208
|
+
await svc1.sync()
|
|
1209
|
+
|
|
1210
|
+
# Get Aha services
|
|
1211
|
+
snfo = await aha.getAhaSvc('01.svc.loop.vertex.link')
|
|
1212
|
+
svcinfo = snfo.get('svcinfo')
|
|
1213
|
+
ready = svcinfo.get('ready')
|
|
1214
|
+
self.true(ready)
|