From 5a4d0b1384c10cdd910e274dcbf62bc04da9a3d8 Mon Sep 17 00:00:00 2001 From: Max Rottenkolber Date: Mon, 10 Oct 2022 13:28:22 +0200 Subject: [PATCH] apps.ipfix: fix bug in selftest --- src/apps/ipfix/ipfix.lua | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/apps/ipfix/ipfix.lua b/src/apps/ipfix/ipfix.lua index 5a8ef46072..522f2cfa0e 100644 --- a/src/apps/ipfix/ipfix.lua +++ b/src/apps/ipfix/ipfix.lua @@ -865,20 +865,23 @@ function selftest() local consts = require("apps.lwaftr.constants") local ethertype_ipv4 = consts.ethertype_ipv4 local ethertype_ipv6 = consts.ethertype_ipv6 - local ipfix = IPFIX:new({ exporter_ip = "192.168.1.2", - collector_ip = "192.168.1.1", - collector_port = 4739, - flush_timeout = 0, - scan_time = 1, - templates = { - 'v4_extended', 'v6_extended' - }, - maps = { - mac_to_as = "apps/ipfix/test/mac_to_as", - vlan_to_ifindex = "apps/ipfix/test/vlan_to_ifindex", - pfx4_to_as = "apps/ipfix/test/pfx4_to_as.csv", - pfx6_to_as = "apps/ipfix/test/pfx6_to_as.csv" - }}) + local conf = { + exporter_ip = "192.168.1.2", + collector_ip = "192.168.1.1", + collector_port = 4739, + flush_timeout = 0, + scan_time = 1, + templates = { + 'v4_extended', 'v6_extended' + }, + maps = { + mac_to_as = "apps/ipfix/test/mac_to_as", + vlan_to_ifindex = "apps/ipfix/test/vlan_to_ifindex", + pfx4_to_as = "apps/ipfix/test/pfx4_to_as.csv", + pfx6_to_as = "apps/ipfix/test/pfx6_to_as.csv" + } + } + local ipfix = IPFIX:new(lib.parse(conf, IPFIX.config)) ipfix.shm = shm.create_frame("apps/ipfix", ipfix.shm) -- Mock input and output.