firewalld/SOURCES/0047-test-dbus-zone-add-nm-shared-to-expected-output-if-i.patch

56 lines
2.3 KiB
Diff
Raw Normal View History

2020-11-14 08:08:47 +00:00
From cd284a0cacb0e9c1b75a7651b83848dd51e52ffd Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Fri, 7 Aug 2020 07:42:00 -0400
Subject: [PATCH] test(dbus): zone: add nm-shared to expected output if it
exists
newer networkmanager ships with this zone. as such, if nm is installed
the expected "get zones" output changes.
(cherry picked from commit a609c15657e68bacbc05d87cb71f366148cb8ced)
(cherry picked from commit 9f8f9390ef0a1631c07cae37be2ab27f29d0f34d)
---
src/tests/dbus/zone_permanent_functional.at | 6 +++++-
src/tests/dbus/zone_runtime_functional.at | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/tests/dbus/zone_permanent_functional.at b/src/tests/dbus/zone_permanent_functional.at
index 2261832e00a8..75645983dbf7 100644
--- a/src/tests/dbus/zone_permanent_functional.at
+++ b/src/tests/dbus/zone_permanent_functional.at
@@ -30,8 +30,12 @@ export DBUS_FOOBAR_ZONE_OBJ
dnl Get Zones
dnl
+if NS_CMD([firewall-cmd --get-zones |grep "nm-shared" >/dev/null]); then
+ NM_SHARED="'nm-shared', "
+ export NM_SHARED
+fi
DBUS_CHECK([config], [config.getZoneNames], [], 0, [dnl
- [(['block', 'dmz', 'drop', 'external', 'foobar', 'home', 'internal', 'public', 'trusted', 'work'],)]
+ (@<:@'block', 'dmz', 'drop', 'external', 'foobar', 'home', 'internal', m4_escape([${NM_SHARED}])'public', 'trusted', 'work'@:>@,)
])
DBUS_CHECK([config], [config.listZones], [], 0, [stdout])
NS_CHECK([sed -e ["s/['][,]/'\n/g"] ./stdout |dnl
diff --git a/src/tests/dbus/zone_runtime_functional.at b/src/tests/dbus/zone_runtime_functional.at
index bb0798abe7da..b5799b9b1ca3 100644
--- a/src/tests/dbus/zone_runtime_functional.at
+++ b/src/tests/dbus/zone_runtime_functional.at
@@ -36,8 +36,12 @@ DBUS_CHECK([], [getDefaultZone], [], 0, [dnl
])
dnl Fetching Zones
+if NS_CMD([firewall-cmd --get-zones |grep "nm-shared" >/dev/null]); then
+ NM_SHARED="'nm-shared', "
+ export NM_SHARED
+fi
DBUS_CHECK([], [zone.getZones], [], 0, [dnl
- [(['block', 'dmz', 'drop', 'external', 'home', 'internal', 'public', 'trusted', 'work'],)]
+ (@<:@'block', 'dmz', 'drop', 'external', 'home', 'internal', m4_escape([${NM_SHARED}])'public', 'trusted', 'work'@:>@,)
])
FWD_CHECK([-q --zone public --add-interface dummy0])
FWD_CHECK([-q --zone public --add-source 10.1.1.1])
--
2.27.0