[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] netif that reads from pcap / hoards writes



Hi Luke,

Ah, I'd thought of regulating the delays in the playback, but not of supplying other stuff in the stack with a stubbed-out OS.Time.sleep. That's a good idea.

The ARP test correctly fails on the current tcpip -- my motivation for writing this particular test was to be able to make some claims about a pull request I made some time ago to mirage-tcpip. I'm currently using it to test whether my attempts to make a better patch for ARP are, in fact, actually better. I should probably add something to the README to that effect.

-Mindy

On 03/12/2015 03:58 PM, Luke Dunstan wrote:
Cool idea.

For most tests I think it would be an advantage to use a stub implementation of OS.Time.sleep so that the tests would run almost instantly, regardless of time-outs. When you need to verify that the unit under test is sleeping for the correct amount of time then you'd need to record the calls to sleep, or something similar.

The ARP test fails for me onÂtest_queries_retried (extra debug messages added):

ARP: sending gratuitous from 192.168.2.222
ARP: updating 192.168.2.7 -> 00:16:3e:7b:2b:4d
ARP: transmitting probe -> 192.168.2.4
# written: 2

ff ff ff ff ff ff ff ff ff ff ff ff 08 06 00 01Â
08 00 06 04 00 01 ff ff ff ff ff ff c0 a8 02 deÂ
ff ff ff ff ff ff c0 a8 02 04Â

ff ff ff ff ff ff ff ff ff ff ff ff 08 06 00 01Â
08 00 06 04 00 02 ff ff ff ff ff ff c0 a8 02 deÂ
ff ff ff ff ff ff 00 00 00 00Â
Fatal error: exception OUnitTest.OUnit_failure("expected: Success but got: Last 3 sent packets weren't ARP probes")
Raised at file "src/core/lwt.ml", line 894, characters 22-23
Called from file "src/unix/lwt_main.ml", line 34, characters 8-18
Called from file "main.ml", line 36, characters 2-28

Looks like the second packet is a gratuitous ARP.

Luke


On 12 March 2015 at 20:54, Mindy <mindy@xxxxxxxxxxxxxxxxxxx> wrote:
Hi all,

I've just made public `mirage-net-pcap`, a module that satisfies V1.NETWORK by supplying packets from a prerecorded pcap file (via crunch) and keeping written packets in memory for later examination. You can see it at https://github.com/yomimono/mirage-net-pcap , and there's an example unikernel using it under `arp_tester` in my example-unikernels repository at https://github.com/yomimono/example-unikernels . `mirage-net-pcap` works with both unix and xen backends, although the example code works only with Unix because of its use of oUnit.

Right now there isn't facility for saving writes to persistent storage (i.e., writing to a pcap). I started writing this and then realized it was generally the opposite of what I actually wanted when writing testing code that used `mirage-net-pcap`, but I do plan on adding this in a later release.

I don't have a fork of the mirage frontend tool that nicely sets up a netif in `config.ml` for the user currently, but stacks can be built on top of one in the normal way (i.e., as in `mirage-skeleton/ethifv4`).

Bad, horrible, okay, other?

-Mindy

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.