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

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