From 0c505899d7360927c7318b253938c21db319b778 Mon Sep 17 00:00:00 2001
From: Dmitri Pal <dpal@redhat.com>
Date: Sun, 26 Dec 2010 00:15:12 -0500
Subject: [PATCH 12/15] [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 0946169..aa73a8a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -250,7 +250,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 0000000..6a9222b
--- /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 0000000..bdec46d
--- /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.7.1

