From 63754e688baba56c7e625b53d39aa7380a754094 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Mon, 25 Oct 2021 09:35:51 -0400
Subject: [PATCH 46/50] test(zone): detect same source/interface in zones
Coverage: rhbz2014383
(cherry picked from commit 6f68d295ac5edcdb10c062e2fba7b810ce2db58c)
(cherry picked from commit a15069d5542c2af391266f2da5f4137766d11a57)
---
src/tests/regression/regression.at | 1 +
src/tests/regression/rhbz2014383.at | 56 +++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
create mode 100644 src/tests/regression/rhbz2014383.at
diff --git a/src/tests/regression/regression.at b/src/tests/regression/regression.at
index f9d42d6e2765..a20b913fbe59 100644
--- a/src/tests/regression/regression.at
+++ b/src/tests/regression/regression.at
@@ -44,3 +44,4 @@ m4_include([regression/rhbz1936896.at])
m4_include([regression/rhbz1914935.at])
m4_include([regression/gh696.at])
m4_include([regression/rhbz1917766.at])
+m4_include([regression/rhbz2014383.at])
diff --git a/src/tests/regression/rhbz2014383.at b/src/tests/regression/rhbz2014383.at
new file mode 100644
index 000000000000..f2ef766dc1b2
--- /dev/null
+++ b/src/tests/regression/rhbz2014383.at
@@ -0,0 +1,56 @@
+FWD_START_TEST([same source in two zone xml])
+AT_KEYWORDS(zone rhbz2014383)
+
+AT_CHECK([mkdir -p ./zones])
+
+AT_DATA([./zones/foobar.xml], [dnl
+<?xml version="1.0" encoding="utf-8"?>
+<zone>
+ <short>foobar</short>
+ <description>foobar</description>
+ <service name="ssh"/>
+ <source address="10.10.10.10"/>
+ <forward/>
+</zone>
+])
+
+AT_DATA([./zones/foobar2.xml], [dnl
+<?xml version="1.0" encoding="utf-8"?>
+<zone>
+ <short>foobar2</short>
+ <description>foobar2</description>
+ <service name="ssh"/>
+ <source address="10.10.10.10"/>
+ <forward/>
+</zone>
+])
+
+FWD_CHECK([--check-config], 105, [ignore], [ignore])
+
+dnl Do the same thing, but with interfaces
+
+AT_DATA([./zones/foobar.xml], [dnl
+<?xml version="1.0" encoding="utf-8"?>
+<zone>
+ <short>foobar</short>
+ <description>foobar</description>
+ <service name="ssh"/>
+ <interface name="foobar0"/>
+ <forward/>
+</zone>
+])
+
+AT_DATA([./zones/foobar2.xml], [dnl
+<?xml version="1.0" encoding="utf-8"?>
+<zone>
+ <short>foobar2</short>
+ <description>foobar2</description>
+ <service name="ssh"/>
+ <interface name="foobar0"/>
+ <forward/>
+</zone>
+])
+
+FWD_CHECK([--check-config], 104, [ignore], [ignore])
+
+FWD_END_TEST([ignore])
--
2.27.0