Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error diagnosis statement needs some improvement #11

Open
jsommers opened this issue Feb 2, 2017 · 0 comments
Open

Error diagnosis statement needs some improvement #11

jsommers opened this issue Feb 2, 2017 · 0 comments
Assignees

Comments

@jsommers
Copy link
Owner

jsommers commented Feb 2, 2017

When a test fails, particularly an output matching expectation, the diagnosis statement can be a bit convoluted and difficult to parse --- it should be improved. Here's an example of a packet output expectation failure, with a couple predicates and inexact matching. It should be easier for someone to read this and immediately pick out the main points.

You called send_packet and while the output port router-eth0 is ok, a inexact match of packet contents passed, but when comparing the packet you sent versus what I expected, the predicate (lambda pkt: pkt[-2].msgtype==4 and len(pkt[-1])==2) passed, the predicate (lambda pkt: set([a.network for a in pkt[-1]])=={IPv4Network("10.0.0.0/30"), IPv4Network("10.0.13.0/24")}) passed, and the predicate (lambda pkt: set([a.routerid for a in pkt[-1]])=={0,2}) failed. Packet field comparisons matched correctly: Ethernet 10:00:00:00:00:01->e0:00:00:00:00:00 IP | IPv4 10.0.0.1->10.0.0.2 OSPF | LSHeader LinkStateUpdate routerid: 13 areaid: 0 | LSUpdate seq 3 ttl 10: <router 0, 10.0.0.0/30>, <router 0, 10.0.13.0/24>..

@jsommers jsommers self-assigned this Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant