selftests: netfilter: fix current year
authorFabian Frederick <fabf@skynet.be>
Sat, 30 Jan 2021 10:14:25 +0000 (11:14 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 3 Feb 2021 23:33:09 +0000 (00:33 +0100)
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>
tools/testing/selftests/netfilter/nft_meta.sh

index 087f0e6..f33154c 100755 (executable)
@@ -23,7 +23,7 @@ ip -net "$ns0" addr add 127.0.0.1 dev lo
 
 trap cleanup EXIT
 
-currentyear=$(date +%G)
+currentyear=$(date +%Y)
 lastyear=$((currentyear-1))
 ip netns exec "$ns0" nft -f /dev/stdin <<EOF
 table inet filter {