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

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