radvd icon indicating copy to clipboard operation
radvd copied to clipboard

thoughts on regression testing for netlink

Open mcr opened this issue 3 years ago • 2 comments

I have thought a bunch about how to test netlink dependant things. I looked at trying to put capture/replay code into libnl, but I gotta say that I found libnl not that helpful, and I had other things to do. radvd doesn't use libnl, and the netlink.c code is pretty sweet. It's not just netlink.c but also recv.c and send.c (really_send()) that need to have a seam inserted. The easiest in my opinion is to move the actual socket creation/manipulation/sendto/recvfrom() code into new .c files, so that a radvd-testing executable can be created that has mock functions. (A "link seam"). I have code that replaces send/recv with calls to pcap(3) functions. netlink sockets can now be captured, I think, with tcpdump, so we'd have a pcap file of RS,NS, etc.. and a pcap file of netlink messages. (Better would be a single pcap-ng file that had both, mixed in the order we need). And a pcap{,-ng} file for output that would capture RAs, NA/ND, etc. [I don't recall if we ever send NAs]

mcr avatar Apr 14 '21 00:04 mcr

to move the actual socket creation/manipulation/sendto/recvfrom() code into new .c files, so that a radvd-testing executable can be created that has mock functions. (A "link seam").

To me that is a reasonable path forward.

stappersg avatar Apr 14 '21 11:04 stappersg

I can't promise that I'll get this organized before the end of April, so I suggest not blocking #127.

mcr avatar Apr 18 '21 22:04 mcr