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