History log of /linux-master/tools/testing/selftests/netfilter/nft_meta.sh
Revision Date Author Comments
# a3005b0f 30-Jan-2021 Fabian Frederick <fabf@skynet.be>

selftests: netfilter: fix current year

use date %Y instead of %G to read current year
Problem appeared when running lkp-tests on 01/01/2021

Fixes: 48d072c4e8cd ("selftests: netfilter: add time counter check")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>


# 48d072c4 23-Sep-2020 Fabian Frederick <fabf@skynet.be>

selftests: netfilter: add time counter check

Check packets are correctly placed in current year.
Also do a NULL check for another one.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>


# d30a7d54 09-Sep-2020 Fabian Frederick <fabf@skynet.be>

selftests: netfilter: remove unused cnt and simplify command testing

cnt was not used in nft_meta.sh
This patch also fixes 2 shellcheck SC2181 warnings:
"check exit code directly with e.g. 'if mycmd;', not indirectly with
$?."

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>


# 5b1a995b 09-Sep-2020 Fabian Frederick <fabf@skynet.be>

selftests: netfilter: fix nft_meta.sh error reporting

When some test directly done with check_one_counter() fails,
counter variable is undefined. This patch calls ip with cname
which avoids errors like:
FAIL: oskuidcounter, want "packets 2", got
Error: syntax error, unexpected newline, expecting string
list counter inet filter
^
Error is now correctly rendered:
FAIL: oskuidcounter, want "packets 2", got
table inet filter {
counter oskuidcounter {
packets 1 bytes 84
}
}

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>


# f02ced62 09-Sep-2020 Fabian Frederick <fabf@skynet.be>

selftests: netfilter: add cpu counter check

run task on first CPU with netfilter counters reset and check
cpu meta after another ping

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>


# 2ef740da 01-Aug-2020 Florian Westphal <fw@strlen.de>

selftests: netfilter: add meta iif/oif match test

simple test case, but would have caught this:

FAIL: iifgroupcount, want "packets 2", got
table inet filter {
counter iifgroupcount {
packets 0 bytes 0
}
}

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>