Comparing output of a command with expected result during runtime

34 views
Skip to first unread message

Shivansh Rai

unread,
Aug 31, 2016, 4:44:13 PM8/31/16
to packetdrill
Hi all,

I am currently working on a test script for handling RST from synchronised (established) state in a FreeBSD VM. What I am trying to do is verify whether we transit to CLOSED state after receiving a RST from the other side. Currently I am checking this using the following command -
`sockstat -s -P tcp -p 8080 | grep 'packetdril' | awk '{print $8}' | grep 'CLOSED'`

However, this simply prints CLOSED during the runtime or aborts in case of any discrepancy. I was wondering that is it possible for us to have some sort of assertion like logic where we can directly compare the output of a specific command with the expected result during the runtime. I am not aware of a method to do so in packetdrill.

Any help will be appreciated.

Thank you.
Regards,
Shivansh

Neal Cardwell

unread,
Sep 17, 2016, 4:28:48 PM9/17/16
to Shivansh Rai, packetdrill
Yes, you can use arbitrary shell commands within the back-ticks, so
you should be able to construct any arbitrary assertion-like logic you
need.

Hope that helps,
neal
> --
> You received this message because you are subscribed to the Google Groups
> "packetdrill" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packetdrill...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages