synapse 2.166.0__py311-none-any.whl → 2.167.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/axon.py +4 -10
- synapse/cortex.py +31 -1
- synapse/exc.py +1 -0
- synapse/lib/aha.py +2 -0
- synapse/lib/base.py +11 -4
- synapse/lib/cell.py +11 -2
- synapse/lib/hive.py +11 -0
- synapse/lib/node.py +4 -2
- synapse/lib/schemas.py +1 -1
- synapse/lib/stormlib/aha.py +366 -16
- synapse/lib/stormlib/macro.py +11 -18
- synapse/lib/stormlib/stix.py +1 -1
- synapse/lib/stormtypes.py +18 -2
- synapse/lib/types.py +2 -0
- synapse/lib/version.py +2 -2
- synapse/lib/view.py +4 -3
- synapse/models/base.py +8 -0
- synapse/models/files.py +3 -0
- synapse/telepath.py +1 -0
- synapse/tests/files/stormpkg/dotstorm/dotstorm.yaml +3 -0
- synapse/tests/test_cortex.py +39 -2
- synapse/tests/test_lib_aha.py +1 -2
- synapse/tests/test_lib_cell.py +6 -2
- synapse/tests/test_lib_grammar.py +62 -64
- synapse/tests/test_lib_httpapi.py +1 -1
- synapse/tests/test_lib_rstorm.py +4 -4
- synapse/tests/test_lib_storm.py +3 -3
- synapse/tests/test_lib_stormlib_aha.py +196 -0
- synapse/tests/test_lib_stormlib_compression.py +12 -12
- synapse/tests/test_lib_stormlib_macro.py +94 -0
- synapse/tests/test_lib_stormlib_spooled.py +1 -1
- synapse/tests/test_lib_stormtypes.py +44 -33
- synapse/tests/test_lib_view.py +50 -3
- synapse/tests/test_model_files.py +3 -0
- synapse/tests/test_tools_genpkg.py +26 -0
- synapse/tests/test_tools_hiveload.py +1 -0
- synapse/tests/test_tools_hivesave.py +1 -0
- synapse/tests/utils.py +22 -3
- synapse/tools/autodoc.py +1 -1
- synapse/tools/hive/load.py +3 -0
- synapse/tools/hive/save.py +3 -0
- {synapse-2.166.0.dist-info → synapse-2.167.0.dist-info}/METADATA +3 -3
- {synapse-2.166.0.dist-info → synapse-2.167.0.dist-info}/RECORD +46 -45
- {synapse-2.166.0.dist-info → synapse-2.167.0.dist-info}/LICENSE +0 -0
- {synapse-2.166.0.dist-info → synapse-2.167.0.dist-info}/WHEEL +0 -0
- {synapse-2.166.0.dist-info → synapse-2.167.0.dist-info}/top_level.txt +0 -0
synapse/models/files.py
CHANGED
synapse/telepath.py
CHANGED
synapse/tests/test_cortex.py
CHANGED
|
@@ -6337,7 +6337,7 @@ class CortexBasicTest(s_t_utils.SynTest):
|
|
|
6337
6337
|
async def action():
|
|
6338
6338
|
await asyncio.sleep(0.1)
|
|
6339
6339
|
await core.callStorm('return($lib.view.get().fork())')
|
|
6340
|
-
await core.callStorm('return($lib.cron.add(query="{
|
|
6340
|
+
await core.callStorm('return($lib.cron.add(query="{meta:note=*}", hourly=30).pack())')
|
|
6341
6341
|
tdef = {'cond': 'node:add', 'storm': '[test:str="foobar"]', 'form': 'test:int'}
|
|
6342
6342
|
opts = {'vars': {'tdef': tdef}}
|
|
6343
6343
|
trig = await core.callStorm('return($lib.trigger.add($tdef))', opts=opts)
|
|
@@ -7007,7 +7007,7 @@ class CortexBasicTest(s_t_utils.SynTest):
|
|
|
7007
7007
|
# clear out the #cno.cve tags and test prune behavior.
|
|
7008
7008
|
await core.nodes('#cno.cve [ -#cno.cve ]')
|
|
7009
7009
|
|
|
7010
|
-
await core.nodes('[ inet:ipv4=1.2.3.4 +#cno.cve.2021.12345.foo +#cno.cve.2021.55555 ]')
|
|
7010
|
+
await core.nodes('[ inet:ipv4=1.2.3.4 +#cno.cve.2021.12345.foo +#cno.cve.2021.55555.bar ]')
|
|
7011
7011
|
|
|
7012
7012
|
await core.nodes('$lib.model.tags.set(cno.cve, prune, (2))')
|
|
7013
7013
|
|
|
@@ -7015,6 +7015,10 @@ class CortexBasicTest(s_t_utils.SynTest):
|
|
|
7015
7015
|
nodes = await core.nodes('[ inet:ipv4=1.2.3.4 -#cno.cve.2021.55555 ]')
|
|
7016
7016
|
self.sorteq(('cno', 'cno.cve', 'cno.cve.2021', 'cno.cve.2021.12345', 'cno.cve.2021.12345.foo'), [t[0] for t in nodes[0].getTags()])
|
|
7017
7017
|
|
|
7018
|
+
# double delete shouldn't prune
|
|
7019
|
+
nodes = await core.nodes('[ inet:ipv4=1.2.3.4 -#cno.cve.2021.55555 ]')
|
|
7020
|
+
self.sorteq(('cno', 'cno.cve', 'cno.cve.2021', 'cno.cve.2021.12345', 'cno.cve.2021.12345.foo'), [t[0] for t in nodes[0].getTags()])
|
|
7021
|
+
|
|
7018
7022
|
# test that the pruning behavior stops at the correct level
|
|
7019
7023
|
nodes = await core.nodes('[ inet:ipv4=1.2.3.4 -#cno.cve.2021.12345.foo ]')
|
|
7020
7024
|
self.sorteq(('cno', 'cno.cve', 'cno.cve.2021', 'cno.cve.2021.12345'), [t[0] for t in nodes[0].getTags()])
|
|
@@ -8018,3 +8022,36 @@ class CortexBasicTest(s_t_utils.SynTest):
|
|
|
8018
8022
|
buf = stream.read()
|
|
8019
8023
|
self.isin('(lowuser) has a rule on the "cortex" authgate', buf)
|
|
8020
8024
|
self.isin('(all) has a rule on the "cortex" authgate', buf)
|
|
8025
|
+
|
|
8026
|
+
async def test_cortex_check_nexus_init(self):
|
|
8027
|
+
# This test is a simple safety net for making sure no nexus events
|
|
8028
|
+
# happen before the nexus subsystem is initialized (initNexusSubsystem).
|
|
8029
|
+
# It's possible for code which calls nexus APIs to run but not do
|
|
8030
|
+
# anything which wouldn't be caught here. I don't think there's a good
|
|
8031
|
+
# way to check for that condition though.
|
|
8032
|
+
|
|
8033
|
+
class Cortex(s_cortex.Cortex):
|
|
8034
|
+
async def initServiceStorage(self):
|
|
8035
|
+
self._test_pre_service_storage_index = await self.nexsroot.index()
|
|
8036
|
+
ret = await super().initServiceStorage()
|
|
8037
|
+
self._test_post_service_storage_index = await self.nexsroot.index()
|
|
8038
|
+
return ret
|
|
8039
|
+
|
|
8040
|
+
async def initNexusSubsystem(self):
|
|
8041
|
+
self._test_pre_nexus_index = await self.nexsroot.index()
|
|
8042
|
+
ret = await super().initNexusSubsystem()
|
|
8043
|
+
self._test_post_nexus_index = await self.nexsroot.index()
|
|
8044
|
+
return ret
|
|
8045
|
+
|
|
8046
|
+
conf = {
|
|
8047
|
+
'layer:lmdb:map_async': True,
|
|
8048
|
+
'nexslog:en': True,
|
|
8049
|
+
'layers:logedits': True,
|
|
8050
|
+
}
|
|
8051
|
+
|
|
8052
|
+
with self.getTestDir() as dirn:
|
|
8053
|
+
async with await Cortex.anit(dirn, conf=conf) as core:
|
|
8054
|
+
offs = core._test_pre_service_storage_index
|
|
8055
|
+
self.eq(core._test_post_service_storage_index, offs)
|
|
8056
|
+
self.eq(core._test_pre_nexus_index, offs)
|
|
8057
|
+
self.ge(core._test_post_nexus_index, core._test_pre_nexus_index)
|
synapse/tests/test_lib_aha.py
CHANGED
|
@@ -6,6 +6,7 @@ from unittest import mock
|
|
|
6
6
|
import synapse.exc as s_exc
|
|
7
7
|
import synapse.axon as s_axon
|
|
8
8
|
import synapse.common as s_common
|
|
9
|
+
import synapse.cortex as s_cortex
|
|
9
10
|
import synapse.telepath as s_telepath
|
|
10
11
|
|
|
11
12
|
import synapse.lib.aha as s_aha
|
|
@@ -1146,8 +1147,6 @@ class AhaTest(s_test.SynTest):
|
|
|
1146
1147
|
|
|
1147
1148
|
async with self.getTestAhaProv() as aha:
|
|
1148
1149
|
|
|
1149
|
-
import synapse.cortex as s_cortex
|
|
1150
|
-
|
|
1151
1150
|
async with await s_base.Base.anit() as base:
|
|
1152
1151
|
|
|
1153
1152
|
with self.getTestDir() as dirn:
|
synapse/tests/test_lib_cell.py
CHANGED
|
@@ -7,6 +7,7 @@ import signal
|
|
|
7
7
|
import socket
|
|
8
8
|
import asyncio
|
|
9
9
|
import tarfile
|
|
10
|
+
import warnings
|
|
10
11
|
import collections
|
|
11
12
|
import multiprocessing
|
|
12
13
|
|
|
@@ -509,8 +510,11 @@ class CellTest(s_t_utils.SynTest):
|
|
|
509
510
|
|
|
510
511
|
s_common.yamlsave(tree, bootpath)
|
|
511
512
|
|
|
512
|
-
|
|
513
|
-
self.
|
|
513
|
+
with warnings.catch_warnings(record=True) as warns:
|
|
514
|
+
async with self.getTestCell(s_cell.Cell, dirn=dirn) as cell:
|
|
515
|
+
self.eq('haha', await cell.hive.get(('hehe',)))
|
|
516
|
+
|
|
517
|
+
self.isin('Initial hive config from hiveboot.yaml', str(warns[0].message))
|
|
514
518
|
|
|
515
519
|
# test that the file does not load again
|
|
516
520
|
tree['kids']['redballoons'] = {'value': 99}
|
|
@@ -94,7 +94,7 @@ Queries = [
|
|
|
94
94
|
'[test:str=foo :tick?=2019 ]',
|
|
95
95
|
'[test:str=a] switch $node.form() { hehe\xa0: {[+#baz]} }',
|
|
96
96
|
'[test:type10=2 :strprop=1] spin | test:type10 +$(:strprop) $foo=1 +$foo',
|
|
97
|
-
'inet:fqdn#xxx.xxxxxx.xxxx.xx for $tag in $node.tags(xxx.xxxxxx.*.xx) { <-
|
|
97
|
+
'inet:fqdn#xxx.xxxxxx.xxxx.xx for $tag in $node.tags(xxx.xxxxxx.*.xx) { <- inet:dns:a +#xx <- meta:note [ +#foo] ->inet:dns:a }',
|
|
98
98
|
' +(syn:tag~=aka.*.mal.*)',
|
|
99
99
|
'+(syn:tag^=aka or syn:tag^=cno or syn:tag^=rep)',
|
|
100
100
|
'[test:str=foo][test:int=42]',
|
|
@@ -113,7 +113,7 @@ Queries = [
|
|
|
113
113
|
'#test.bar +test:pivcomp -> *',
|
|
114
114
|
'#test.bar +test:str <+- *',
|
|
115
115
|
'#test.bar +test:str <- *',
|
|
116
|
-
'test:migr <-
|
|
116
|
+
'test:migr <- meta:note',
|
|
117
117
|
'#test.bar -#test -+> *',
|
|
118
118
|
'#test.bar -#test -> *',
|
|
119
119
|
'#test.bar -#test <+- *',
|
|
@@ -130,7 +130,7 @@ Queries = [
|
|
|
130
130
|
'.created="{created}"',
|
|
131
131
|
'.seen [ -.seen ]',
|
|
132
132
|
'.seen~="^r"',
|
|
133
|
-
"[
|
|
133
|
+
"[meta:note='*' :type=m1]",
|
|
134
134
|
'[ geo:place="*" :latlong=(-30.0,20.22) ]',
|
|
135
135
|
'[ inet:asn=200 :name=visi ]',
|
|
136
136
|
'[ inet:dns:a = ( woot.com , 12.34.56.78 ) ]',
|
|
@@ -192,11 +192,11 @@ Queries = [
|
|
|
192
192
|
'[ test:str=woot .seen=(2014,2015) ]',
|
|
193
193
|
'[ test:str=woot .seen=20 ]',
|
|
194
194
|
'[-#foo]',
|
|
195
|
-
'[
|
|
196
|
-
'[
|
|
197
|
-
'[
|
|
198
|
-
'[
|
|
199
|
-
'[
|
|
195
|
+
'[meta:seen=((test:str, foobar), (test:str, foo))]',
|
|
196
|
+
'[meta:seen=((test:comp, (2048, horton)), (test:comp, (4096, whoville)))]',
|
|
197
|
+
'[meta:seen=((test:comp, (9001, "A mean one")), (test:comp, (40000, greeneggs)))]',
|
|
198
|
+
'[meta:seen=((test:int, 16), (test:comp, (9999, greenham)))]',
|
|
199
|
+
'[meta:seen=((test:str, 123), (test:int, 123))]',
|
|
200
200
|
'[inet:dns:query=(tcp://1.2.3.4, "", 1)]',
|
|
201
201
|
'[inet:dns:query=(tcp://1.2.3.4, "foo*.haha.com", 1)]',
|
|
202
202
|
'[inet:ipv4=1.2.3.1-1.2.3.3]',
|
|
@@ -220,9 +220,8 @@ Queries = [
|
|
|
220
220
|
'[test:str=foo :tick=201808021201]',
|
|
221
221
|
'[test:str=hehe] | iden abcd | count',
|
|
222
222
|
'[test:str=hello]',
|
|
223
|
-
'
|
|
224
|
-
'
|
|
225
|
-
'edge:wentto',
|
|
223
|
+
'meta:seen +:node*range=((test:comp, (1000, green)), (test:comp, (3000, ham)))',
|
|
224
|
+
'meta:seen',
|
|
226
225
|
'file:bytes:size=4',
|
|
227
226
|
'for $fqdn in $fqdns { [ inet:fqdn=$fqdn ] }',
|
|
228
227
|
'for ($fqdn, $ipv4) in $dnsa { [ inet:dns:a=($fqdn,$ipv4) ] }',
|
|
@@ -233,10 +232,10 @@ Queries = [
|
|
|
233
232
|
'geo:place:latlong*near=(("34.118560", "-118.300370"), 50m)',
|
|
234
233
|
'geo:place:latlong*near=((0, 0), 50m)',
|
|
235
234
|
'geo:place:latlong*near=((34.1, -118.3), 10km)',
|
|
236
|
-
'geo:place=$place <-
|
|
237
|
-
'geo:place=$place <-
|
|
235
|
+
'geo:place=$place <- meta:seen <- *',
|
|
236
|
+
'geo:place=$place <- meta:seen <- ps:person',
|
|
238
237
|
'geo:place=abcd $latlong=:latlong $radius=:radius | spin | tel:mob:telem:latlong*near=($latlong, 3km)',
|
|
239
|
-
'
|
|
238
|
+
'meta:note=abcd | noderefs -d 2 --join',
|
|
240
239
|
'help',
|
|
241
240
|
'iden 2cdd997872b10a65407ad5fadfa28e0d',
|
|
242
241
|
'iden deadb33f',
|
|
@@ -291,11 +290,11 @@ Queries = [
|
|
|
291
290
|
'meta:source=8f1401de15918358d5247e21ca29a814',
|
|
292
291
|
'movetag a.b a.m',
|
|
293
292
|
'movetag hehe woot',
|
|
294
|
-
'ps:person=$pers ->
|
|
295
|
-
'ps:person=$pers ->
|
|
296
|
-
'ps:person=$pers ->
|
|
297
|
-
'ps:person=$pers ->
|
|
298
|
-
'ps:person=$pers ->
|
|
293
|
+
'ps:person=$pers -> meta:seen -> *',
|
|
294
|
+
'ps:person=$pers -> meta:seen -> geo:place',
|
|
295
|
+
'ps:person=$pers -> meta:seen +:time@=(2014,2017) -> geo:place',
|
|
296
|
+
'ps:person=$pers -> meta:seen -> *',
|
|
297
|
+
'ps:person=$pers -> meta:seen :node -> *',
|
|
299
298
|
'reindex --form-counts',
|
|
300
299
|
'sudo | [ inet:ipv4=1.2.3.4 ]',
|
|
301
300
|
'sudo | [ test:cycle0=foo :test:cycle1=bar ]',
|
|
@@ -445,12 +444,12 @@ Queries = [
|
|
|
445
444
|
'test:str=bar <- *',
|
|
446
445
|
'test:str=bar test:pivcomp=(foo,bar) [+#test.bar]',
|
|
447
446
|
'test:str=foo +#lol@=2016',
|
|
448
|
-
'test:str=foo <+-
|
|
449
|
-
'test:str=foo <-
|
|
447
|
+
'test:str=foo <+- meta:seen',
|
|
448
|
+
'test:str=foo <- meta:seen',
|
|
450
449
|
'test:str=foo | delnode',
|
|
451
|
-
'test:str=foobar -+>
|
|
452
|
-
'test:str=foobar ->
|
|
453
|
-
'test:str=foobar ->
|
|
450
|
+
'test:str=foobar -+> meta:seen',
|
|
451
|
+
'test:str=foobar -> meta:seen <+- test:str',
|
|
452
|
+
'test:str=foobar -> meta:seen <- test:str',
|
|
454
453
|
'test:str=hello [:tick="2001"]',
|
|
455
454
|
'test:str=hello [:tick="2002"]',
|
|
456
455
|
'test:str=pennywise | noderefs --join -d 9 --traverse-edge',
|
|
@@ -515,7 +514,7 @@ Queries = [
|
|
|
515
514
|
|
|
516
515
|
{[ inet:email:message:attachment=($node, "*") ] -inet:email:message [ :name=sploit.exe ]}
|
|
517
516
|
|
|
518
|
-
{[
|
|
517
|
+
{[ meta:seen=($node, ('inet:email:header', ('to', 'Visi Kensho <visi@vertex.link>'))) ]}
|
|
519
518
|
''',
|
|
520
519
|
'$x = $(1 / 3)',
|
|
521
520
|
'$x = $(1 * 3)',
|
|
@@ -687,18 +686,18 @@ Queries = [
|
|
|
687
686
|
'reverse(*$form=$valu)',
|
|
688
687
|
'test:str=foobar -> inet:dns*',
|
|
689
688
|
'test:str=foobar -> inet:dns:*',
|
|
690
|
-
'test:str=foobar -> (
|
|
691
|
-
'test:str=foobar -> (
|
|
689
|
+
'test:str=foobar -> (meta:seen, inet:dns:a)',
|
|
690
|
+
'test:str=foobar -> (meta:seen, inet:dns*)',
|
|
692
691
|
'test:str=foobar -> $foo',
|
|
693
692
|
'test:str=foobar -+> inet:dns*',
|
|
694
693
|
'test:str=foobar -+> inet:dns:*',
|
|
695
|
-
'test:str=foobar -+> (
|
|
696
|
-
'test:str=foobar -+> (
|
|
694
|
+
'test:str=foobar -+> (meta:seen, inet:dns:a)',
|
|
695
|
+
'test:str=foobar -+> (meta:seen, inet:dns*)',
|
|
697
696
|
'test:str=foobar -+> $foo',
|
|
698
697
|
'test:str=foobar -(refs)> inet:dns:*',
|
|
699
|
-
'inet:fqdn=foo.com :zone -> (
|
|
698
|
+
'inet:fqdn=foo.com :zone -> (meta:seen, inet:dns:a)',
|
|
700
699
|
'inet:fqdn=foo.com :zone -> $foo',
|
|
701
|
-
'inet:fqdn=foo.com :zone -+> (
|
|
700
|
+
'inet:fqdn=foo.com :zone -+> (meta:seen, inet:dns:a)',
|
|
702
701
|
'inet:fqdn=foo.com :zone -+> $foo',
|
|
703
702
|
'test:*#foo',
|
|
704
703
|
'test:*#foo@=2016',
|
|
@@ -809,7 +808,7 @@ _ParseResults = [
|
|
|
809
808
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: foo], EditPropSet: [RelProp: [Const: tick], Const: ?=, Const: 2019]]',
|
|
810
809
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: a], SwitchCase: [FuncCall: [VarDeref: [VarValue: [Const: node], Const: form], CallArgs: [], CallKwargs: []], CaseEntry: [Const: hehe, SubQuery: [Query: [EditTagAdd: [TagName: [Const: baz]]]]]]]',
|
|
811
810
|
'Query: [EditNodeAdd: [FormName: [Const: test:type10], Const: =, Const: 2], EditPropSet: [RelProp: [Const: strprop], Const: =, Const: 1], CmdOper: [Const: spin, Const: ()], LiftProp: [Const: test:type10], FiltOper: [Const: +, DollarExpr: [RelPropValue: [Const: strprop]]], SetVarOper: [Const: foo, Const: 1], FiltOper: [Const: +, VarValue: [Const: foo]]]',
|
|
812
|
-
'Query: [LiftFormTag: [Const: inet:fqdn, TagName: [Const: xxx, Const: xxxxxx, Const: xxxx, Const: xx]], ForLoop: [Const: tag, FuncCall: [VarDeref: [VarValue: [Const: node], Const: tags], CallArgs: [Const: xxx.xxxxxx.*.xx], CallKwargs: []], SubQuery: [Query: [PivotInFrom: [Const:
|
|
811
|
+
'Query: [LiftFormTag: [Const: inet:fqdn, TagName: [Const: xxx, Const: xxxxxx, Const: xxxx, Const: xx]], ForLoop: [Const: tag, FuncCall: [VarDeref: [VarValue: [Const: node], Const: tags], CallArgs: [Const: xxx.xxxxxx.*.xx], CallKwargs: []], SubQuery: [Query: [PivotInFrom: [Const: inet:dns:a], isjoin=False, FiltOper: [Const: +, TagCond: [TagMatch: [Const: xx]]], PivotInFrom: [Const: meta:note], isjoin=False, EditTagAdd: [TagName: [Const: foo]], FormPivot: [Const: inet:dns:a], isjoin=False]]]]',
|
|
813
812
|
'Query: [FiltOper: [Const: +, AbsPropCond: [Const: syn:tag, Const: ~=, Const: aka.*.mal.*]]]',
|
|
814
813
|
'Query: [FiltOper: [Const: +, OrCond: [OrCond: [AbsPropCond: [Const: syn:tag, Const: ^=, Const: aka], AbsPropCond: [Const: syn:tag, Const: ^=, Const: cno]], AbsPropCond: [Const: syn:tag, Const: ^=, Const: rep]]]]',
|
|
815
814
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: foo], EditNodeAdd: [FormName: [Const: test:int], Const: =, Const: 42]]',
|
|
@@ -828,7 +827,7 @@ _ParseResults = [
|
|
|
828
827
|
'Query: [LiftTag: [TagName: [Const: test, Const: bar]], FiltOper: [Const: +, HasAbsPropCond: [Const: test:pivcomp]], PivotOut: [], isjoin=False]',
|
|
829
828
|
'Query: [LiftTag: [TagName: [Const: test, Const: bar]], FiltOper: [Const: +, HasAbsPropCond: [Const: test:str]], PivotIn: [], isjoin=True]',
|
|
830
829
|
'Query: [LiftTag: [TagName: [Const: test, Const: bar]], FiltOper: [Const: +, HasAbsPropCond: [Const: test:str]], PivotIn: [], isjoin=False]',
|
|
831
|
-
'Query: [LiftProp: [Const: test:migr], PivotInFrom: [Const:
|
|
830
|
+
'Query: [LiftProp: [Const: test:migr], PivotInFrom: [Const: meta:note], isjoin=False]',
|
|
832
831
|
'Query: [LiftTag: [TagName: [Const: test, Const: bar]], FiltOper: [Const: -, TagCond: [TagMatch: [Const: test]]], PivotOut: [], isjoin=True]',
|
|
833
832
|
'Query: [LiftTag: [TagName: [Const: test, Const: bar]], FiltOper: [Const: -, TagCond: [TagMatch: [Const: test]]], PivotOut: [], isjoin=False]',
|
|
834
833
|
'Query: [LiftTag: [TagName: [Const: test, Const: bar]], FiltOper: [Const: -, TagCond: [TagMatch: [Const: test]]], PivotIn: [], isjoin=True]',
|
|
@@ -845,7 +844,7 @@ _ParseResults = [
|
|
|
845
844
|
'Query: [LiftPropBy: [Const: .created, Const: =, Const: {created}]]',
|
|
846
845
|
'Query: [LiftProp: [Const: .seen], EditUnivDel: [UnivProp: [Const: .seen]]]',
|
|
847
846
|
'Query: [LiftPropBy: [Const: .seen, Const: ~=, Const: ^r]]',
|
|
848
|
-
'Query: [EditNodeAdd: [FormName: [Const:
|
|
847
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:note], Const: =, Const: *], EditPropSet: [RelProp: [Const: type], Const: =, Const: m1]]',
|
|
849
848
|
'Query: [EditNodeAdd: [FormName: [Const: geo:place], Const: =, Const: *], EditPropSet: [RelProp: [Const: latlong], Const: =, List: [Const: -30.0, Const: 20.22]]]',
|
|
850
849
|
'Query: [EditNodeAdd: [FormName: [Const: inet:asn], Const: =, Const: 200], EditPropSet: [RelProp: [Const: name], Const: =, Const: visi]]',
|
|
851
850
|
'Query: [EditNodeAdd: [FormName: [Const: inet:dns:a], Const: =, List: [Const: woot.com, Const: 12.34.56.78]]]',
|
|
@@ -907,11 +906,11 @@ _ParseResults = [
|
|
|
907
906
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: woot], EditPropSet: [UnivProp: [Const: .seen], Const: =, List: [Const: 2014, Const: 2015]]]',
|
|
908
907
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: woot], EditPropSet: [UnivProp: [Const: .seen], Const: =, Const: 20]]',
|
|
909
908
|
'Query: [EditTagDel: [TagName: [Const: foo]]]',
|
|
910
|
-
'Query: [EditNodeAdd: [FormName: [Const:
|
|
911
|
-
'Query: [EditNodeAdd: [FormName: [Const:
|
|
912
|
-
'Query: [EditNodeAdd: [FormName: [Const:
|
|
913
|
-
'Query: [EditNodeAdd: [FormName: [Const:
|
|
914
|
-
'Query: [EditNodeAdd: [FormName: [Const:
|
|
909
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:seen], Const: =, List: [List: [Const: test:str, Const: foobar], List: [Const: test:str, Const: foo]]]]',
|
|
910
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:seen], Const: =, List: [List: [Const: test:comp, List: [Const: 2048, Const: horton]], List: [Const: test:comp, List: [Const: 4096, Const: whoville]]]]]',
|
|
911
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:seen], Const: =, List: [List: [Const: test:comp, List: [Const: 9001, Const: A mean one]], List: [Const: test:comp, List: [Const: 40000, Const: greeneggs]]]]]',
|
|
912
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:seen], Const: =, List: [List: [Const: test:int, Const: 16], List: [Const: test:comp, List: [Const: 9999, Const: greenham]]]]]',
|
|
913
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:seen], Const: =, List: [List: [Const: test:str, Const: 123], List: [Const: test:int, Const: 123]]]]',
|
|
915
914
|
'Query: [EditNodeAdd: [FormName: [Const: inet:dns:query], Const: =, List: [Const: tcp://1.2.3.4, Const: , Const: 1]]]',
|
|
916
915
|
'Query: [EditNodeAdd: [FormName: [Const: inet:dns:query], Const: =, List: [Const: tcp://1.2.3.4, Const: foo*.haha.com, Const: 1]]]',
|
|
917
916
|
'Query: [EditNodeAdd: [FormName: [Const: inet:ipv4], Const: =, Const: 1.2.3.1-1.2.3.3]]',
|
|
@@ -935,9 +934,8 @@ _ParseResults = [
|
|
|
935
934
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: foo], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 201808021201]]',
|
|
936
935
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: hehe], CmdOper: [Const: iden, List: [Const: abcd]], CmdOper: [Const: count, Const: ()]]',
|
|
937
936
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: hello]]',
|
|
938
|
-
'Query: [LiftProp: [Const:
|
|
939
|
-
'Query: [LiftProp: [Const:
|
|
940
|
-
'Query: [LiftProp: [Const: edge:wentto]]',
|
|
937
|
+
'Query: [LiftProp: [Const: meta:seen], FiltOper: [Const: +, RelPropCond: [RelPropValue: [RelProp: [Const: node]], Const: range=, List: [List: [Const: test:comp, List: [Const: 1000, Const: green]], List: [Const: test:comp, List: [Const: 3000, Const: ham]]]]]]',
|
|
938
|
+
'Query: [LiftProp: [Const: meta:seen]]',
|
|
941
939
|
'Query: [LiftPropBy: [Const: file:bytes:size, Const: =, Const: 4]]',
|
|
942
940
|
'Query: [ForLoop: [Const: fqdn, VarValue: [Const: fqdns], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:fqdn], Const: =, VarValue: [Const: fqdn]]]]]]',
|
|
943
941
|
"Query: [ForLoop: [VarList: ['fqdn', 'ipv4'], VarValue: [Const: dnsa], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:dns:a], Const: =, List: [VarValue: [Const: fqdn], VarValue: [Const: ipv4]]]]]]]",
|
|
@@ -948,10 +946,10 @@ _ParseResults = [
|
|
|
948
946
|
'Query: [LiftPropBy: [Const: geo:place:latlong, Const: near=, List: [List: [Const: 34.118560, Const: -118.300370], Const: 50m]]]',
|
|
949
947
|
'Query: [LiftPropBy: [Const: geo:place:latlong, Const: near=, List: [List: [Const: 0, Const: 0], Const: 50m]]]',
|
|
950
948
|
'Query: [LiftPropBy: [Const: geo:place:latlong, Const: near=, List: [List: [Const: 34.1, Const: -118.3], Const: 10km]]]',
|
|
951
|
-
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const:
|
|
952
|
-
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const:
|
|
949
|
+
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const: meta:seen], isjoin=False, PivotIn: [], isjoin=False]',
|
|
950
|
+
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const: meta:seen], isjoin=False, PivotInFrom: [Const: ps:person], isjoin=False]',
|
|
953
951
|
'Query: [LiftPropBy: [Const: geo:place, Const: =, Const: abcd], SetVarOper: [Const: latlong, RelPropValue: [Const: latlong]], SetVarOper: [Const: radius, RelPropValue: [Const: radius]], CmdOper: [Const: spin, Const: ()], LiftPropBy: [Const: tel:mob:telem:latlong, Const: near=, List: [VarValue: [Const: latlong], Const: 3km]]]',
|
|
954
|
-
'Query: [LiftPropBy: [Const:
|
|
952
|
+
'Query: [LiftPropBy: [Const: meta:note, Const: =, Const: abcd], CmdOper: [Const: noderefs, List: [Const: -d, Const: 2, Const: --join]]]',
|
|
955
953
|
'Query: [CmdOper: [Const: help, Const: ()]]',
|
|
956
954
|
'Query: [CmdOper: [Const: iden, List: [Const: 2cdd997872b10a65407ad5fadfa28e0d]]]',
|
|
957
955
|
'Query: [CmdOper: [Const: iden, List: [Const: deadb33f]]]',
|
|
@@ -1006,11 +1004,11 @@ _ParseResults = [
|
|
|
1006
1004
|
'Query: [LiftPropBy: [Const: meta:source, Const: =, Const: 8f1401de15918358d5247e21ca29a814]]',
|
|
1007
1005
|
'Query: [CmdOper: [Const: movetag, List: [Const: a.b, Const: a.m]]]',
|
|
1008
1006
|
'Query: [CmdOper: [Const: movetag, List: [Const: hehe, Const: woot]]]',
|
|
1009
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const:
|
|
1010
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const:
|
|
1011
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const:
|
|
1012
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const:
|
|
1013
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const:
|
|
1007
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:seen], isjoin=False, PivotOut: [], isjoin=False]',
|
|
1008
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:seen], isjoin=False, FormPivot: [Const: geo:place], isjoin=False]',
|
|
1009
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:seen], isjoin=False, FiltOper: [Const: +, RelPropCond: [RelPropValue: [RelProp: [Const: time]], Const: @=, List: [Const: 2014, Const: 2017]]], FormPivot: [Const: geo:place], isjoin=False]',
|
|
1010
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:seen], isjoin=False, PivotOut: [], isjoin=False]',
|
|
1011
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:seen], isjoin=False, PropPivotOut: [RelProp: [Const: node]], isjoin=False]',
|
|
1014
1012
|
'Query: [CmdOper: [Const: reindex, List: [Const: --form-counts]]]',
|
|
1015
1013
|
'Query: [CmdOper: [Const: sudo, Const: ()], EditNodeAdd: [FormName: [Const: inet:ipv4], Const: =, Const: 1.2.3.4]]',
|
|
1016
1014
|
'Query: [CmdOper: [Const: sudo, Const: ()], EditNodeAdd: [FormName: [Const: test:cycle0], Const: =, Const: foo], EditPropSet: [RelProp: [Const: test:cycle1], Const: =, Const: bar]]',
|
|
@@ -1160,12 +1158,12 @@ _ParseResults = [
|
|
|
1160
1158
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: bar], PivotIn: [], isjoin=False]',
|
|
1161
1159
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: bar], LiftPropBy: [Const: test:pivcomp, Const: =, List: [Const: foo, Const: bar]], EditTagAdd: [TagName: [Const: test, Const: bar]]]',
|
|
1162
1160
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], FiltOper: [Const: +, TagValuCond: [TagMatch: [Const: lol], Const: @=, Const: 2016]]]',
|
|
1163
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const:
|
|
1164
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const:
|
|
1161
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const: meta:seen], isjoin=True]',
|
|
1162
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const: meta:seen], isjoin=False]',
|
|
1165
1163
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], CmdOper: [Const: delnode, Const: ()]]',
|
|
1166
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const:
|
|
1167
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const:
|
|
1168
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const:
|
|
1164
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:seen], isjoin=True]',
|
|
1165
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:seen], isjoin=False, PivotInFrom: [Const: test:str], isjoin=True]',
|
|
1166
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:seen], isjoin=False, PivotInFrom: [Const: test:str], isjoin=False]',
|
|
1169
1167
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: hello], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 2001]]',
|
|
1170
1168
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: hello], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 2002]]',
|
|
1171
1169
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: pennywise], CmdOper: [Const: noderefs, List: [Const: --join, Const: -d, Const: 9, Const: --traverse-edge]]]',
|
|
@@ -1185,7 +1183,7 @@ _ParseResults = [
|
|
|
1185
1183
|
"Query: [ForLoop: [Const: foo, VarValue: [Const: foos], SubQuery: [Query: [VarListSetOper: [VarList: ['fqdn', 'ipv4'], FuncCall: [VarDeref: [VarValue: [Const: foo], Const: split], CallArgs: [Const: |], CallKwargs: []]], EditNodeAdd: [FormName: [Const: inet:dns:a], Const: =, List: [VarValue: [Const: fqdn], VarValue: [Const: ipv4]]]]]]]",
|
|
1186
1184
|
'Query: [ForLoop: [Const: tag, FuncCall: [VarDeref: [VarValue: [Const: node], Const: tags], CallArgs: [], CallKwargs: []], SubQuery: [Query: [FormPivot: [Const: test:int], isjoin=False, EditTagAdd: [TagName: [VarValue: [Const: tag]]]]]]]',
|
|
1187
1185
|
'Query: [ForLoop: [Const: tag, FuncCall: [VarDeref: [VarValue: [Const: node], Const: tags], CallArgs: [Const: fo*], CallKwargs: []], SubQuery: [Query: [FormPivot: [Const: test:int], isjoin=False, EditTagDel: [TagName: [VarValue: [Const: tag]]]]]]]',
|
|
1188
|
-
'Query: [EditNodeAdd: [FormName: [Const: inet:email:message], Const: =, Const: *], EditPropSet: [RelProp: [Const: to], Const: =, Const: woot@woot.com], EditPropSet: [RelProp: [Const: from], Const: =, Const: visi@vertex.link], EditPropSet: [RelProp: [Const: replyto], Const: =, Const: root@root.com], EditPropSet: [RelProp: [Const: subject], Const: =, Const: hi there], EditPropSet: [RelProp: [Const: date], Const: =, Const: 2015], EditPropSet: [RelProp: [Const: body], Const: =, Const: there are mad sploitz here!], EditPropSet: [RelProp: [Const: bytes], Const: =, Const: *], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:link], Const: =, List: [VarValue: [Const: node], Const: https://www.vertex.link]]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:attachment], Const: =, List: [VarValue: [Const: node], Const: *]], FiltOper: [Const: -, HasAbsPropCond: [Const: inet:email:message]], EditPropSet: [RelProp: [Const: name], Const: =, Const: sploit.exe]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const:
|
|
1186
|
+
'Query: [EditNodeAdd: [FormName: [Const: inet:email:message], Const: =, Const: *], EditPropSet: [RelProp: [Const: to], Const: =, Const: woot@woot.com], EditPropSet: [RelProp: [Const: from], Const: =, Const: visi@vertex.link], EditPropSet: [RelProp: [Const: replyto], Const: =, Const: root@root.com], EditPropSet: [RelProp: [Const: subject], Const: =, Const: hi there], EditPropSet: [RelProp: [Const: date], Const: =, Const: 2015], EditPropSet: [RelProp: [Const: body], Const: =, Const: there are mad sploitz here!], EditPropSet: [RelProp: [Const: bytes], Const: =, Const: *], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:link], Const: =, List: [VarValue: [Const: node], Const: https://www.vertex.link]]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:attachment], Const: =, List: [VarValue: [Const: node], Const: *]], FiltOper: [Const: -, HasAbsPropCond: [Const: inet:email:message]], EditPropSet: [RelProp: [Const: name], Const: =, Const: sploit.exe]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: meta:seen], Const: =, List: [VarValue: [Const: node], List: [Const: inet:email:header, List: [Const: to, Const: Visi Kensho <visi@vertex.link>]]]]]]]',
|
|
1189
1187
|
'Query: [SetVarOper: [Const: x, DollarExpr: [ExprNode: [Const: 1, Const: /, Const: 3]]]]',
|
|
1190
1188
|
'Query: [SetVarOper: [Const: x, DollarExpr: [ExprNode: [Const: 1, Const: *, Const: 3]]]]',
|
|
1191
1189
|
'Query: [SetVarOper: [Const: x, DollarExpr: [ExprNode: [ExprNode: [Const: 1, Const: *, Const: 3], Const: +, Const: 2]]]]',
|
|
@@ -1313,18 +1311,18 @@ _ParseResults = [
|
|
|
1313
1311
|
'Query: [LiftPropBy: [VarValue: [Const: form], Const: =, VarValue: [Const: valu]]]',
|
|
1314
1312
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns*], isjoin=False]',
|
|
1315
1313
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns:*], isjoin=False]',
|
|
1316
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const:
|
|
1317
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const:
|
|
1314
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:seen, Const: inet:dns:a]], isjoin=False]',
|
|
1315
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:seen, Const: inet:dns*]], isjoin=False]',
|
|
1318
1316
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [VarValue: [Const: foo]], isjoin=False]',
|
|
1319
1317
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns*], isjoin=True]',
|
|
1320
1318
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns:*], isjoin=True]',
|
|
1321
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const:
|
|
1322
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const:
|
|
1319
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:seen, Const: inet:dns:a]], isjoin=True]',
|
|
1320
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:seen, Const: inet:dns*]], isjoin=True]',
|
|
1323
1321
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [VarValue: [Const: foo]], isjoin=True]',
|
|
1324
1322
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], N1Walk: [Const: refs, Const: inet:dns:*], isjoin=False]',
|
|
1325
|
-
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const:
|
|
1323
|
+
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const: meta:seen, Const: inet:dns:a]], isjoin=False]',
|
|
1326
1324
|
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], VarValue: [Const: foo]], isjoin=False]',
|
|
1327
|
-
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const:
|
|
1325
|
+
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const: meta:seen, Const: inet:dns:a]], isjoin=True]',
|
|
1328
1326
|
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], VarValue: [Const: foo]], isjoin=True]',
|
|
1329
1327
|
'Query: [LiftFormTag: [Const: test:*, TagName: [Const: foo]]]',
|
|
1330
1328
|
'Query: [LiftFormTag: [Const: test:*, TagName: [Const: foo], Const: @=, Const: 2016]]',
|
|
@@ -1385,13 +1383,13 @@ class GrammarTest(s_t_utils.SynTest):
|
|
|
1385
1383
|
self.eq(str(tree), _ParseResults[i])
|
|
1386
1384
|
|
|
1387
1385
|
def test_cmdrargs(self):
|
|
1388
|
-
q = '''add {inet:fqdn | graph 2 --filter { -#nope } } inet:f-M +1 { [
|
|
1386
|
+
q = '''add {inet:fqdn | graph 2 --filter { -#nope } } inet:f-M +1 { [ meta:note='*' :type=m1]}'''
|
|
1389
1387
|
correct = (
|
|
1390
1388
|
'add',
|
|
1391
1389
|
'inet:fqdn | graph 2 --filter { -#nope }',
|
|
1392
1390
|
'inet:f-M',
|
|
1393
1391
|
'+1',
|
|
1394
|
-
"[
|
|
1392
|
+
"[ meta:note='*' :type=m1]"
|
|
1395
1393
|
)
|
|
1396
1394
|
parser = s_parser.Parser(q)
|
|
1397
1395
|
args = parser.cmdrargs()
|
|
@@ -902,7 +902,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
902
902
|
self.eq(info['creator'], root.iden)
|
|
903
903
|
self.eq(info['iden'], view)
|
|
904
904
|
|
|
905
|
-
cdef = await core.callStorm('return($lib.cron.add(query="{
|
|
905
|
+
cdef = await core.callStorm('return($lib.cron.add(query="{meta:note=*}", hourly=30).pack())')
|
|
906
906
|
layr = await core.callStorm('return($lib.layer.add().iden)')
|
|
907
907
|
|
|
908
908
|
opts = {'vars': {'view': view, 'cron': cdef['iden'], 'layr': layr}}
|
synapse/tests/test_lib_rstorm.py
CHANGED
|
@@ -206,7 +206,7 @@ multiline00_input = '''
|
|
|
206
206
|
A multiline secondary property.
|
|
207
207
|
.. storm-cortex:: default
|
|
208
208
|
.. storm-opts:: {"vars": {"name": "Node\\nWith a\\nweird name"}}
|
|
209
|
-
.. storm:: [
|
|
209
|
+
.. storm:: [meta:note=(n1,) :text=$name]
|
|
210
210
|
Bye!
|
|
211
211
|
'''
|
|
212
212
|
|
|
@@ -214,9 +214,9 @@ multiline00_output = '''
|
|
|
214
214
|
A multiline secondary property.
|
|
215
215
|
::
|
|
216
216
|
|
|
217
|
-
> [
|
|
218
|
-
|
|
219
|
-
:
|
|
217
|
+
> [meta:note=(n1,) :text=$name]
|
|
218
|
+
meta:note=85d3511b97098d7fd9e07be21f6390de
|
|
219
|
+
:text = Node
|
|
220
220
|
With a
|
|
221
221
|
weird name
|
|
222
222
|
|
synapse/tests/test_lib_storm.py
CHANGED
|
@@ -2505,9 +2505,9 @@ class StormTest(s_t_utils.SynTest):
|
|
|
2505
2505
|
nodes = await core.nodes('test:comp $valu=({"foo": :hehe}) | uniq $valu')
|
|
2506
2506
|
self.len(1, nodes)
|
|
2507
2507
|
q = '''
|
|
2508
|
-
[(
|
|
2509
|
-
(
|
|
2510
|
-
(
|
|
2508
|
+
[(tel:mob:telem=(n1,) :data=(({'hehe': 'haha', 'foo': 'bar'}),))
|
|
2509
|
+
(tel:mob:telem=(n2,) :data=(({'hehe': 'haha', 'foo': 'baz'}),))
|
|
2510
|
+
(tel:mob:telem=(n3,) :data=(({'foo': 'bar', 'hehe': 'haha'}),))]
|
|
2511
2511
|
uniq :data
|
|
2512
2512
|
'''
|
|
2513
2513
|
nodes = await core.nodes(q)
|