async def do00EmptyQuery(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: for _ in range(self.workfactor // 10): count = await acount(prox.eval('')) assert count == 0 return self.workfactor // 10
async def do09DelNodes(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:url | delnode')) assert count == 0 return self.workfactor
async def do07AddNodesPresent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.addNodes(self.testdata.ips)) assert count == self.workfactor return count
async def do06PivotPresent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:ipv4#even -> inet:dns:a')) assert count == self.workfactor // 2 + self.workfactor // 10 return count
async def do05PivotAbsent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:ipv4#odd -> inet:dns:a')) assert count == 0 return self.workfactor // 2
async def do04LiftByTagPresent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:ipv4#even')) assert count == self.workfactor // 2 return count
async def do04LiftByTagAbsent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:ipv4#newp')) assert count == 0 return 1
async def do03LiftBySecondaryPresent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:dns:a:fqdn=blackhole.website')) assert count == self.workfactor // 10 return count
async def do03LiftBySecondaryAbsent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:dns:a:fqdn=newp')) assert count == 0 return 1
async def do02LiftFilterPresent(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:ipv4 | +#all')) assert count == self.workfactor return count
async def do01SimpleCount(self, core: s_cortex.Cortex, prox: s_telepath.Client) -> int: count = await acount(prox.eval('inet:ipv4 | count | spin')) assert count == 0 return self.workfactor