]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add profile tests for final nodes
authorGreg Hudson <ghudson@mit.edu>
Mon, 15 Jul 2019 19:09:30 +0000 (15:09 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 23 Jul 2019 19:55:16 +0000 (15:55 -0400)
src/util/profile/Makefile.in
src/util/profile/final.expected [new file with mode: 0644]
src/util/profile/final1.ini [new file with mode: 0644]
src/util/profile/final2.ini [new file with mode: 0644]
src/util/profile/final3.ini [new file with mode: 0644]
src/util/profile/final4.ini [new file with mode: 0644]
src/util/profile/final5.ini [new file with mode: 0644]

index ba589c42501fdfde627f55741aff54857d81fde9..079443e620891e3fdb714e8477423340dbb1a073 100644 (file)
@@ -129,7 +129,7 @@ profile_tcl: profile_tcl.o $(PROF_DEPLIB) $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
 clean-unix:: clean-libs clean-libobjs
        $(RM) $(PROGS) *.o *~ core prof_err.h profile.h prof_err.c
        $(RM) test_load test_parse test_profile test_vtable profile_tcl
-       $(RM) modtest.conf testinc.ini testinc2.ini
+       $(RM) modtest.conf testinc.ini testinc2.ini final.out
        $(RM) -r test_include_dir
 
 clean-windows::
@@ -140,7 +140,23 @@ check-unix: test_parse test_profile test_vtable test_load modtest.conf
        $(RUN_TEST) ./test_load
 
 DO_TCL=@DO_TCL@
-check-unix: check-unix-tcl-$(DO_TCL)
+check-unix: check-unix-final check-unix-tcl-$(DO_TCL)
+
+F1=$(srcdir)/final1.ini
+F2=$(srcdir)/final2.ini
+F3=$(srcdir)/final3.ini
+F4=$(srcdir)/final4.ini
+F5=$(srcdir)/final5.ini
+QUERY=query section subsection key
+check-unix-final: test_profile
+       $(RM) final.out
+       (echo; $(RUN_TEST) ./test_profile $(F1):$(F1) $(QUERY)) > final.out
+       (echo; $(RUN_TEST) ./test_profile $(F2):$(F1) $(QUERY)) >> final.out
+       (echo; $(RUN_TEST) ./test_profile $(F3):$(F1) $(QUERY)) >> final.out
+       (echo; $(RUN_TEST) ./test_profile $(F4):$(F1) $(QUERY)) >> final.out
+       (echo; $(RUN_TEST) ./test_profile $(F5):$(F1) $(QUERY)) >> final.out
+       cmp final.out $(srcdir)/final.expected
+       $(RM) final.out
 
 check-unix-tcl-:
        @echo "+++"
diff --git a/src/util/profile/final.expected b/src/util/profile/final.expected
new file mode 100644 (file)
index 0000000..fb23b3c
--- /dev/null
@@ -0,0 +1,12 @@
+
+value1
+value1
+
+value2
+value1
+
+value3
+
+value4
+
+value5
diff --git a/src/util/profile/final1.ini b/src/util/profile/final1.ini
new file mode 100644 (file)
index 0000000..0419add
--- /dev/null
@@ -0,0 +1,6 @@
+# A basic profile setting a single relation in a subsection, with
+# nothing marked final.
+[section]
+       subsection = {
+               key = value1
+       }
diff --git a/src/util/profile/final2.ini b/src/util/profile/final2.ini
new file mode 100644 (file)
index 0000000..4b1e15b
--- /dev/null
@@ -0,0 +1,7 @@
+# In this variant the relation is marked final.  There is parsing
+# support for this but no iteration or dumping support, so the marker
+# currently has no effect.
+[section]
+       subsection = {
+               key* = value2
+       }
diff --git a/src/util/profile/final3.ini b/src/util/profile/final3.ini
new file mode 100644 (file)
index 0000000..dcf0ca9
--- /dev/null
@@ -0,0 +1,6 @@
+# In this variant the subsection is marked final via a '*' at the end
+# of the tag name.
+[section]
+       subsection* = {
+               key = value3
+       }
diff --git a/src/util/profile/final4.ini b/src/util/profile/final4.ini
new file mode 100644 (file)
index 0000000..dcba078
--- /dev/null
@@ -0,0 +1,6 @@
+# In this variant the subsection is marked final via a '*' after the
+# closing brace.
+[section]
+       subsection = {
+               key = value4
+       }*
diff --git a/src/util/profile/final5.ini b/src/util/profile/final5.ini
new file mode 100644 (file)
index 0000000..58cd57d
--- /dev/null
@@ -0,0 +1,5 @@
+# In this variant the top-level section is marked final.
+[section]*
+       subsection = {
+               key = value5
+       }