Blame SOURCES/0123-fix-test-CHECK_NAT_COEXISTENCE-only-check-for-kernel.patch

bb602c
From c150db55fdd5d5fa32fa957b84db506561b0f501 Mon Sep 17 00:00:00 2001
bb602c
From: Eric Garver <eric@garver.life>
bb602c
Date: Mon, 2 Dec 2019 09:08:00 -0500
bb602c
Subject: [PATCH 123/146] fix: test: CHECK_NAT_COEXISTENCE: only check for
bb602c
 kernel version
bb602c
bb602c
Calling modprobe is problematic inside a container. Just check if the
bb602c
running kernel is >4.18 as this is when NAT coexistence was fixed.
bb602c
bb602c
(cherry picked from commit 2b7d150d4b15b4b3876df0179cd08aaae33f2e38)
bb602c
(cherry picked from commit 837e15fa66478db597161f89c2364ccb10012bce)
bb602c
---
bb602c
 src/tests/functions.at | 9 ++-------
bb602c
 1 file changed, 2 insertions(+), 7 deletions(-)
bb602c
bb602c
diff --git a/src/tests/functions.at b/src/tests/functions.at
bb602c
index d663716cb138..74cb889c7a29 100644
bb602c
--- a/src/tests/functions.at
bb602c
+++ b/src/tests/functions.at
bb602c
@@ -376,13 +376,8 @@ m4_define([CHECK_NAT_COEXISTENCE], [
bb602c
     m4_if(nftables, FIREWALL_BACKEND, [
bb602c
         KERNEL_MAJOR=`uname -r | cut -d. -f1`
bb602c
         KERNEL_MINOR=`uname -r | cut -d. -f2`
bb602c
-        if test ${KERNEL_MAJOR} -eq 4 && test ${KERNEL_MINOR} -ge 16 || test ${KERNEL_MAJOR} -gt 4; then
bb602c
-            dnl Only check >=4.16 kernels. Previous versions did not explicitly
bb602c
-            dnl deny it, but had undefined behavior.
bb602c
-            AT_SKIP_IF([! modprobe iptable_nat])
bb602c
-            AT_SKIP_IF([! NS_CMD([nft add table ip foobar])])
bb602c
-            AT_SKIP_IF([! NS_CMD([nft add chain ip foobar foobar_chain { type nat hook postrouting priority 100 \; }])])
bb602c
-            NS_CHECK([nft delete table ip foobar])
bb602c
+        if test ${KERNEL_MAJOR} -eq 4 && test ${KERNEL_MINOR} -ge 18 || test ${KERNEL_MAJOR} -gt 4; then
bb602c
+            :
bb602c
         else
bb602c
             AT_SKIP_IF([true])
bb602c
         fi
bb602c
-- 
bb602c
2.23.0
bb602c