MCPcopy Create free account
hub / github.com/Edgio/vflow / TestMultiMessage

Function TestMultiMessage

ipfix/decoder_test.go:181–197  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

179}
180
181func TestMultiMessage(t *testing.T) {
182 ip := net.ParseIP("127.0.0.1")
183 mCache := GetCache("cache.file")
184 d := NewDecoder(ip, multiMessage)
185 r, err := d.Decode(mCache)
186 if err != nil {
187 t.Error("unexpected error happened:", err)
188 }
189 if l := len(r.DataSets); l != 3 {
190 t.Error("Expected 3 datasets, but received", l)
191 }
192 expectedSets := []int{256, 257, 262, 263, 264, 265, 266, 267, 268, 512}
193 actualSets := mCache.allSetIds()
194 if !reflect.DeepEqual(expectedSets, actualSets) {
195 t.Error("Expected template sets:", expectedSets, ", but received:", actualSets)
196 }
197}
198
199func TestUnknownDatasetsMessage(t *testing.T) {
200 ip := net.ParseIP("127.0.0.1")

Callers

nothing calls this directly

Calls 4

DecodeMethod · 0.95
allSetIdsMethod · 0.80
GetCacheFunction · 0.70
NewDecoderFunction · 0.70

Tested by

no test coverage detected