Multi-step input files and tests

Multi-step input files and tests
0

Found that one of my ind scripts for F5 was missing test files after the migration to the new awk parser. Tried to re-add it but I am failing because of the following error:


Message = Header = Execution Error,
Description = Failed to find matching input,
Message = key not found: HttpOperation(GET "/mgmt/tm/vcmp/guest/stats", headers: Map(), body: None),
,

2017-12-02 12:49:09,027 ERROR – Command execution failure
indeni.collector.CommandFailure: Header = Command execution error,
Description = Command “f5-rest-mgmt-tm-vcmp-guest-stats” failed to execute,
Message = Header = Execution Error,
Description = Failed to find matching input,
Message = key not found: HttpOperation(GET “/mgmt/tm/vcmp/guest/stats”, headers: Map(), body: None),
,

    at indeni.collector.actors.ResultsHandler$$anonfun$waitingForResults$1.applyOrElse(ResultsHandler.scala:74)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:497)
    at indeni.collector.actors.ResultsHandler.aroundReceive(ResultsHandler.scala:24)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
    at akka.actor.ActorCell.invoke(ActorCell.scala:495)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
    at akka.dispatch.Mailbox.run(Mailbox.scala:224)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Caused by: indeni.collector.GenericFailure: Header = Execution Error,
Description = Failed to find matching input,
Message = key not found: HttpOperation(GET “/mgmt/tm/vcmp/guest/stats”, headers: Map(), body: None),

    at indeni.collector.commandrunner.CommandParserExecutor$DummyClientActor$$anonfun$receive$1.applyOrElse(CommandParserExecutor.scala:139)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:497)
    at indeni.collector.commandrunner.CommandParserExecutor$DummyClientActor.aroundReceive(CommandParserExecutor.scala:125)
    ... 9 common frames omitted

Caused by: java.util.NoSuchElementException: key not found: HttpOperation(GET “/mgmt/tm/vcmp/guest/stats”, headers: Map(), body: None)
at scala.collection.MapLike$class.default(MapLike.scala:228)
at scala.collection.AbstractMap.default(Map.scala:59)
at scala.collection.MapLike$class.apply(MapLike.scala:141)
at scala.collection.AbstractMap.apply(Map.scala:59)
at indeni.collector.commandrunner.CommandParserExecutor$DummyClientActor$$anonfun$receive$1$$anonfun$4.apply(CommandParserExecutor.scala:133)
at scala.util.Try$.apply(Try.scala:192)
at indeni.collector.commandrunner.CommandParserExecutor$DummyClientActor$$anonfun$receive$1.applyOrElse(CommandParserExecutor.scala:132)
… 11 common frames omitted
2017-12-02 12:49:09,029 INFO – Exiting

Previously I believe this error indicated that there was no inputs that matched the outcome of the dynamic variable(s). But I ran the first section and it spits out the value I expect it to.


Link to the ind script:

https://pastebin.com/PX6GJYfR


Link to the input file:

https://pastebin.com/qZw5p8xB


I was wondering if this article on multi-step is still valid or if I missed something? My code is the same as before the new awk parser barring the referral to the dynamic and temp variables.


/Patrik

The expected value is set in the input.json. Does the value in there match the output of the first part of the .ind script?

Mina input.json looks like this for one script

{"steps":[[{"variables":{},"path":"input_0_0"}],[{"variables":{"multistepList":"192.168.197.14:899711ebae4fb70d5c6ac95b66c238b3:indeni.local__AD"},"path":"input_1_0"}]]}
Do you also have input_0_0 and input_1_0 files? One for each of the stages of the script.

Check out parsers\test\checkpoint\firewall\ldap-fingerprint-check folder in staging to see a successfull multi-step test case

For people interested, there is a longer dicussion about multi-step issues here: https://community.indeni.com/discussions/topics/45813