2 ms·
I couldn't make it past serialization/deserialization logic in my own hobbiest TCP/IP stack. Even that part was super buggy. Next time around I'm definitely goi
by eatonphil 5y ago
I couldn't make it past serialization/deserialization logic in my own hobbiest TCP/IP stack. Even that part was super buggy. Next time around I'm definitely going to be unit testing more parts otherwise it's too hard for a beginner to get the easy parts right let alone the harder parts.
Also, take a look at gvisor's network stack. It's definitely unit tested.
https://github.com/google/gvisor/tree/master/pkg/tcpip/link/ethernet https://github.com/google/gvisor/tree/master/pkg/tcpip/link/... (an example)
- amscanne 5y agoThis is perhaps a better example: https://github.com/google/gvisor/blob/master/pkg/tcpip/transport/tcp/tcp_test.go https://github.com/google/gvisor/blob/master/pkg/tcpip/trans... Also, some networking tests use separate frameworks (which look more like the setup the original post is describing, since those are needed also), e.g.: https://github.com/google/gvisor/tree/master/test/packetimpact/tests https://github.com/google/gvisor/tree/master/test/packetimpa...