|
|
c8bceb |
From dd6dfcced04fc8a0b14f95a1d01d49f5c677f334 Mon Sep 17 00:00:00 2001
|
|
|
c8bceb |
From: Eric Garver <eric@garver.life>
|
|
|
c8bceb |
Date: Mon, 16 Sep 2019 15:47:53 -0400
|
|
|
c8bceb |
Subject: [PATCH 103/109] test: helper: coverage for custom helper
|
|
|
c8bceb |
|
|
|
c8bceb |
(cherry picked from commit 3adabc19a9ac447c3e89a7b344b2e106f44d96f1)
|
|
|
c8bceb |
(cherry picked from commit 40d53d4086a69c6c6275b6fa38d33f8c92e719f9)
|
|
|
c8bceb |
---
|
|
|
c8bceb |
src/tests/features.at | 2 ++
|
|
|
c8bceb |
src/tests/features/helpers_custom.at | 40 ++++++++++++++++++++++++++++
|
|
|
c8bceb |
src/tests/testsuite.at | 1 +
|
|
|
c8bceb |
3 files changed, 43 insertions(+)
|
|
|
c8bceb |
create mode 100644 src/tests/features.at
|
|
|
c8bceb |
create mode 100644 src/tests/features/helpers_custom.at
|
|
|
c8bceb |
|
|
|
c8bceb |
diff --git a/src/tests/features.at b/src/tests/features.at
|
|
|
c8bceb |
new file mode 100644
|
|
|
c8bceb |
index 000000000000..2da3dbad04c2
|
|
|
c8bceb |
--- /dev/null
|
|
|
c8bceb |
+++ b/src/tests/features.at
|
|
|
c8bceb |
@@ -0,0 +1,2 @@
|
|
|
c8bceb |
+AT_BANNER([features (FIREWALL_BACKEND)])
|
|
|
c8bceb |
+m4_include([features/helpers_custom.at])
|
|
|
c8bceb |
diff --git a/src/tests/features/helpers_custom.at b/src/tests/features/helpers_custom.at
|
|
|
c8bceb |
new file mode 100644
|
|
|
c8bceb |
index 000000000000..b5f745761407
|
|
|
c8bceb |
--- /dev/null
|
|
|
c8bceb |
+++ b/src/tests/features/helpers_custom.at
|
|
|
c8bceb |
@@ -0,0 +1,40 @@
|
|
|
c8bceb |
+FWD_START_TEST([service include])
|
|
|
c8bceb |
+AT_KEYWORDS(helpers rhbz1733066)
|
|
|
c8bceb |
+
|
|
|
c8bceb |
+FWD_CHECK([-q --permanent --new-helper="ftptest" --module="nf_conntrack_ftp"])
|
|
|
c8bceb |
+FWD_CHECK([-q --permanent --helper=ftptest --add-port="2121/tcp"])
|
|
|
c8bceb |
+
|
|
|
c8bceb |
+FWD_CHECK([-q --permanent --new-service="ftptest"])
|
|
|
c8bceb |
+FWD_CHECK([-q --permanent --service=ftptest --add-module="nf_conntrack_ftptest"])
|
|
|
c8bceb |
+FWD_CHECK([-q --permanent --service=ftptest --add-port="2121/tcp"])
|
|
|
c8bceb |
+FWD_RELOAD
|
|
|
c8bceb |
+
|
|
|
c8bceb |
+FWD_CHECK([-q --add-service=ftptest])
|
|
|
c8bceb |
+
|
|
|
c8bceb |
+NFT_LIST_RULES([inet], [filter_IN_public_allow], 0, [dnl
|
|
|
c8bceb |
+ table inet firewalld {
|
|
|
c8bceb |
+ chain filter_IN_public_allow {
|
|
|
c8bceb |
+ tcp dport 22 ct state new,untracked accept
|
|
|
c8bceb |
+ ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
|
|
|
c8bceb |
+ tcp dport 2121 ct helper set "helper-ftptest-tcp"
|
|
|
c8bceb |
+ tcp dport 2121 ct state new,untracked accept
|
|
|
c8bceb |
+ }
|
|
|
c8bceb |
+ }
|
|
|
c8bceb |
+])
|
|
|
c8bceb |
+IPTABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
|
|
|
c8bceb |
+ CT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2121 CT helper ftp
|
|
|
c8bceb |
+])
|
|
|
c8bceb |
+IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
|
|
|
c8bceb |
+ ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
|
|
|
c8bceb |
+ ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2121 ctstate NEW,UNTRACKED
|
|
|
c8bceb |
+])
|
|
|
c8bceb |
+IP6TABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
|
|
|
c8bceb |
+ CT tcp ::/0 ::/0 tcp dpt:2121 CT helper ftp
|
|
|
c8bceb |
+])
|
|
|
c8bceb |
+IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
|
|
|
c8bceb |
+ ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
|
|
|
c8bceb |
+ ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
|
|
|
c8bceb |
+ ACCEPT tcp ::/0 ::/0 tcp dpt:2121 ctstate NEW,UNTRACKED
|
|
|
c8bceb |
+])
|
|
|
c8bceb |
+
|
|
|
c8bceb |
+FWD_END_TEST
|
|
|
c8bceb |
diff --git a/src/tests/testsuite.at b/src/tests/testsuite.at
|
|
|
c8bceb |
index 68d18c9018b8..e83d61d5bf0a 100644
|
|
|
c8bceb |
--- a/src/tests/testsuite.at
|
|
|
c8bceb |
+++ b/src/tests/testsuite.at
|
|
|
c8bceb |
@@ -14,4 +14,5 @@ m4_foreach([FIREWALL_BACKEND], [[iptables]], [
|
|
|
c8bceb |
m4_include([firewall-cmd.at])
|
|
|
c8bceb |
m4_include([regression.at])
|
|
|
c8bceb |
m4_include([python.at])
|
|
|
c8bceb |
+ m4_include([features.at])
|
|
|
c8bceb |
])
|
|
|
c8bceb |
--
|
|
|
c8bceb |
2.20.1
|
|
|
c8bceb |
|