|
|
792c82 |
From 7c06edce03bcf408a4aa6a9d64b17dafcb951224 Mon Sep 17 00:00:00 2001
|
|
|
792c82 |
From: Eric Garver <eric@garver.life>
|
|
|
792c82 |
Date: Tue, 3 Sep 2019 12:57:29 -0400
|
|
|
792c82 |
Subject: [PATCH 50/50] fix: tests/regression/rhbz1723610: make deterministic
|
|
|
792c82 |
|
|
|
792c82 |
Use --query-rule. The --get-all-rules output is not necessarily in any
|
|
|
792c82 |
defined order.
|
|
|
792c82 |
|
|
|
792c82 |
Fixes: 0220c8584512 ("fix: tests/regression/rhbz1723610: better coverage")
|
|
|
792c82 |
(cherry picked from commit 441a4ef405b869b4c68bbbac21f001814578df08)
|
|
|
792c82 |
(cherry picked from commit 3a634eb266f60bc8419f5e3d37abd425e2d4dff5)
|
|
|
792c82 |
---
|
|
|
792c82 |
src/tests/regression/rhbz1723610.at | 35 +++++++++++++----------------
|
|
|
792c82 |
1 file changed, 16 insertions(+), 19 deletions(-)
|
|
|
792c82 |
|
|
|
792c82 |
diff --git a/src/tests/regression/rhbz1723610.at b/src/tests/regression/rhbz1723610.at
|
|
|
792c82 |
index 70eb226cb6df..0d0810cc8623 100644
|
|
|
792c82 |
--- a/src/tests/regression/rhbz1723610.at
|
|
|
792c82 |
+++ b/src/tests/regression/rhbz1723610.at
|
|
|
792c82 |
@@ -4,31 +4,28 @@ AT_KEYWORDS(direct rhbz1723610 gh385)
|
|
|
792c82 |
FWD_CHECK([-q --permanent --direct --add-rule ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT])
|
|
|
792c82 |
FWD_CHECK([-q --permanent --direct --add-rule ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT])
|
|
|
792c82 |
FWD_CHECK([-q --permanent --direct --add-rule ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT])
|
|
|
792c82 |
-FWD_CHECK([--permanent --direct --get-all-rules], 0, [dnl
|
|
|
792c82 |
-ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-])
|
|
|
792c82 |
+FWD_CHECK([-q --permanent --direct --query-rule ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --permanent --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --permanent --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
FWD_RELOAD
|
|
|
792c82 |
-FWD_CHECK([--direct --get-all-rules], 0, [dnl
|
|
|
792c82 |
-ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-])
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
|
|
|
792c82 |
FWD_CHECK([-q --permanent --direct --remove-rules ipv6 filter INPUT])
|
|
|
792c82 |
FWD_CHECK([-q --permanent --direct --remove-rules ipv4 filter INPUT])
|
|
|
792c82 |
-FWD_CHECK([--permanent --direct --get-all-rules], 0, [dnl
|
|
|
792c82 |
-ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-])
|
|
|
792c82 |
+FWD_CHECK([-q --permanent --direct --query-rule ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --permanent --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
+FWD_CHECK([-q --permanent --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
FWD_RELOAD
|
|
|
792c82 |
-FWD_CHECK([--direct --get-all-rules], 0, [dnl
|
|
|
792c82 |
-ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-])
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
FWD_CHECK([-q --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 22 -j ACCEPT])
|
|
|
792c82 |
FWD_CHECK([-q --direct --remove-rules ipv4 filter OUTPUT])
|
|
|
792c82 |
-FWD_CHECK([--direct --get-all-rules], 0, [dnl
|
|
|
792c82 |
-ipv4 filter INPUT 0 -p tcp --dport 22 -j ACCEPT
|
|
|
792c82 |
-])
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -p tcp --dport 22 -j ACCEPT], 0)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter OUTPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.1 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
+FWD_CHECK([-q --direct --query-rule ipv4 filter INPUT 0 -d 127.0.0.2 -p tcp --dport 22 -j ACCEPT], 1)
|
|
|
792c82 |
|
|
|
792c82 |
FWD_END_TEST
|
|
|
792c82 |
--
|
|
|
792c82 |
2.23.0
|
|
|
792c82 |
|