From 235393228925b4aee6138820276450c233853464 Mon Sep 17 00:00:00 2001
From: Dmitri Pal <dpal@redhat.com>
Date: Sun, 26 Dec 2010 00:15:12 -0500
Subject: [PATCH] [INI] New test files for section merge

smerge.conf  - test file
sexpect.conf - file contains output of the smerge.conf
               processed in different merge modes
               for sections and values
---
 Makefile.am            |    4 +-
 ini/ini.d/sexpect.conf |  644 ++++++++++++++++++++++++++++++++++++++++++++++++
 ini/ini.d/smerge.conf  |   33 +++
 3 files changed, 680 insertions(+), 1 deletions(-)
 create mode 100644 ini/ini.d/sexpect.conf
 create mode 100644 ini/ini.d/smerge.conf

diff --git a/Makefile.am b/Makefile.am
index 1780e9b234e68006af910413b3e8312c9db72c7b..4f9ab3427bb309b19ddec0da5e2125046d03babc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -280,7 +280,9 @@ dist_noinst_DATA += \
     ini/ini.d/test.conf \
     ini/ini.d/ipa.conf \
     ini/ini.d/foo.conf \
-    ini/ini.d/mysssd.conf
+    ini/ini.d/mysssd.conf \
+    ini/ini.d/smerge.conf \
+    ini/ini.d/sexpect.conf
 
 check_PROGRAMS += \
     ini_config_ut \
diff --git a/ini/ini.d/sexpect.conf b/ini/ini.d/sexpect.conf
new file mode 100644
index 0000000000000000000000000000000000000000..6a9222b0a9003ed1a6e9c10401573832980a3706
--- /dev/null
+++ b/ini/ini.d/sexpect.conf
@@ -0,0 +1,644 @@
+# Section mode: MERGE, value mode: OVERWRITE
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: MERGE, value mode: ERROR
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: MERGE, value mode: PRESERVE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+#End of file
+# Section mode: MERGE, value mode: ALLOW
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: MERGE, value mode: DETECT
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: ERROR, value mode: OVERWRITE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: ERROR, value mode: ERROR
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: ERROR, value mode: PRESERVE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: ERROR, value mode: ALLOW
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: ERROR, value mode: DETECT
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: OVERWRITE, value mode: OVERWRITE
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: OVERWRITE, value mode: ERROR
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: OVERWRITE, value mode: PRESERVE
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: OVERWRITE, value mode: ALLOW
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: OVERWRITE, value mode: DETECT
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: PRESERVE, value mode: OVERWRITE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: PRESERVE, value mode: ERROR
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: PRESERVE, value mode: PRESERVE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: PRESERVE, value mode: ALLOW
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: PRESERVE, value mode: DETECT
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: ALLOW, value mode: OVERWRITE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: ALLOW, value mode: ERROR
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: ALLOW, value mode: PRESERVE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: ALLOW, value mode: ALLOW
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: ALLOW, value mode: DETECT
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: DETECT, value mode: OVERWRITE
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: DETECT, value mode: ERROR
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Section mode: DETECT, value mode: PRESERVE
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+#End of file
+# Section mode: DETECT, value mode: ALLOW
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
+# Section mode: DETECT, value mode: DETECT
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
diff --git a/ini/ini.d/smerge.conf b/ini/ini.d/smerge.conf
new file mode 100644
index 0000000000000000000000000000000000000000..bdec46d86fb6ecd0d39f4b50aca01a53dabd9ebf
--- /dev/null
+++ b/ini/ini.d/smerge.conf
@@ -0,0 +1,33 @@
+[section1]
+# Key 1
+key1 = section1a Value 1
+# Key 2
+key2 = section1a Value 2
+# Key 3
+key3 = section1a Value 3
+
+[section2]
+# Key 1
+key1 = section2a Value 1
+# Key 2
+key2 = section2a Value 2
+# Key 3
+key3 = section2a Value 3
+
+[section1]
+# Key 1
+key1 = section1b Value 1
+# Key 2
+key2 = section1b Value 2
+# Key 3
+key3 = section1b Value 3
+
+[section2]
+# Key 1
+key1 = section2b Value 1
+# Key 2
+key2 = section2b Value 2
+# Key 3
+key3 = section2b Value 3
+
+#End of file
-- 
1.5.5.6

