trace packets that are sent outside of a connection

This commit is contained in:
Marten Seemann 2020-07-16 08:20:36 +07:00
parent f10894a1ce
commit 0c551c893c
9 changed files with 99 additions and 0 deletions

View file

@ -56,6 +56,15 @@ var _ = Describe("Tracing", func() {
})
It("traces the PacketSent event", func() {
remote := &net.UDPAddr{IP: net.IPv4(4, 3, 2, 1)}
hdr := &Header{DestConnectionID: ConnectionID{1, 2, 3}}
f := &MaxDataFrame{MaximumData: 1337}
tr1.EXPECT().SentPacket(remote, hdr, ByteCount(1024), []Frame{f})
tr2.EXPECT().SentPacket(remote, hdr, ByteCount(1024), []Frame{f})
tracer.SentPacket(remote, hdr, 1024, []Frame{f})
})
It("traces the PacketDropped event", func() {
remote := &net.UDPAddr{IP: net.IPv4(4, 3, 2, 1)}
tr1.EXPECT().DroppedPacket(remote, PacketTypeRetry, ByteCount(1024), PacketDropDuplicate)
tr2.EXPECT().DroppedPacket(remote, PacketTypeRetry, ByteCount(1024), PacketDropDuplicate)