r1926@ken-wireless: raeburn | 2008-07-15 16:49:17 -0400
authorKen Raeburn <raeburn@mit.edu>
Tue, 15 Jul 2008 23:57:03 +0000 (23:57 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 15 Jul 2008 23:57:03 +0000 (23:57 +0000)
 ticket: 5947
 status: open

 Add a test script for the walk_rtree code, and run some test cases
 that exercise the problem reported in RT ticket 5947.
 r1927@ken-wireless:  raeburn | 2008-07-15 19:55:10 -0400
 Some more test cases.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20528 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/Makefile.in
src/lib/krb5/krb/walktree-tests [new file with mode: 0644]

index 93d31db41c24b7f7c72c42182961b41a65dc17a6..46a5363b6e83e858fb904c917727c81cf91bae5c 100644 (file)
@@ -354,6 +354,7 @@ check-unix:: $(TEST_PROGS)
                $(RUN_SETUP) $(VALGRIND) ./t_ser
        $(RUN_SETUP) $(VALGRIND) ./t_deltat
        $(RUN_SETUP) $(VALGRIND) sh $(srcdir)/transit-tests
+       $(RUN_SETUP) $(VALGRIND) sh $(srcdir)/walktree-tests
 
 clean::
        $(RM) $(OUTPRE)t_walk_rtree$(EXEEXT) $(OUTPRE)t_walk_rtree.$(OBJEXT) \
diff --git a/src/lib/krb5/krb/walktree-tests b/src/lib/krb5/krb/walktree-tests
new file mode 100644 (file)
index 0000000..99561c5
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# Test the walk_rtree.c code.
+#
+
+#error: wanted
+#got tgt list:
+check='echo Running walk_rtree test $1 $2 ... ; ans=`./t_walk_rtree $1 $2 | sed -e s,krbtgt/,,g`; ans=`echo $ans`; echo Got TGT list: "$ans" ; if test "$3" != "$ans" ; then err=1; echo ERROR: wanted "$3"; fi; echo ""'
+
+err=0
+
+set ATHENA.MIT.EDU HACK.EXAMPLE.COM "ATHENA.MIT.EDU@ATHENA.MIT.EDU MIT.EDU@ATHENA.MIT.EDU EDU@MIT.EDU COM@EDU EXAMPLE.COM@COM HACK.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set ATHENA.MIT.EDU CSAIL.MIT.EDU "ATHENA.MIT.EDU@ATHENA.MIT.EDU MIT.EDU@ATHENA.MIT.EDU CSAIL.MIT.EDU@MIT.EDU"
+eval $check
+
+set FOO.EXAMPLE.COM BAR.EXAMPLE.COM "FOO.EXAMPLE.COM@FOO.EXAMPLE.COM EXAMPLE.COM@FOO.EXAMPLE.COM BAR.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set FOZ.EXAMPLE.COM BAZ.EXAMPLE.COM "FOZ.EXAMPLE.COM@FOZ.EXAMPLE.COM EXAMPLE.COM@FOZ.EXAMPLE.COM BAZ.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set FOZ.EXAMPLE.COM BOZ.EXAMPLE.COM "FOZ.EXAMPLE.COM@FOZ.EXAMPLE.COM EXAMPLE.COM@FOZ.EXAMPLE.COM BOZ.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set FOZ.EXAMPLE.COM OZ.EXAMPLE.COM "FOZ.EXAMPLE.COM@FOZ.EXAMPLE.COM EXAMPLE.COM@FOZ.EXAMPLE.COM OZ.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set OZ.EXAMPLE.COM FOZ.EXAMPLE.COM "OZ.EXAMPLE.COM@OZ.EXAMPLE.COM EXAMPLE.COM@OZ.EXAMPLE.COM FOZ.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set A.FOZ.EXAMPLE.COM A.OZ.EXAMPLE.COM "A.FOZ.EXAMPLE.COM@A.FOZ.EXAMPLE.COM FOZ.EXAMPLE.COM@A.FOZ.EXAMPLE.COM EXAMPLE.COM@FOZ.EXAMPLE.COM OZ.EXAMPLE.COM@EXAMPLE.COM A.OZ.EXAMPLE.COM@OZ.EXAMPLE.COM"
+eval $check
+
+set A.OZ.EXAMPLE.COM A.FOZ.EXAMPLE.COM "A.OZ.EXAMPLE.COM@A.OZ.EXAMPLE.COM OZ.EXAMPLE.COM@A.OZ.EXAMPLE.COM EXAMPLE.COM@OZ.EXAMPLE.COM FOZ.EXAMPLE.COM@EXAMPLE.COM A.FOZ.EXAMPLE.COM@FOZ.EXAMPLE.COM"
+eval $check
+
+set A.FOZ.EXAMPLE.COM A.BOZ.EXAMPLE.COM "A.FOZ.EXAMPLE.COM@A.FOZ.EXAMPLE.COM FOZ.EXAMPLE.COM@A.FOZ.EXAMPLE.COM EXAMPLE.COM@FOZ.EXAMPLE.COM BOZ.EXAMPLE.COM@EXAMPLE.COM A.BOZ.EXAMPLE.COM@BOZ.EXAMPLE.COM"
+eval $check
+
+set A.BOZ.EXAMPLE.COM A.FOZ.EXAMPLE.COM "A.BOZ.EXAMPLE.COM@A.BOZ.EXAMPLE.COM BOZ.EXAMPLE.COM@A.BOZ.EXAMPLE.COM EXAMPLE.COM@BOZ.EXAMPLE.COM FOZ.EXAMPLE.COM@EXAMPLE.COM A.FOZ.EXAMPLE.COM@FOZ.EXAMPLE.COM"
+eval $check
+
+set A.FOZ.EXAMPLE.COM OZ.EXAMPLE.COM "A.FOZ.EXAMPLE.COM@A.FOZ.EXAMPLE.COM FOZ.EXAMPLE.COM@A.FOZ.EXAMPLE.COM EXAMPLE.COM@FOZ.EXAMPLE.COM OZ.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set OZ.EXAMPLE.COM A.FOZ.EXAMPLE.COM "OZ.EXAMPLE.COM@OZ.EXAMPLE.COM EXAMPLE.COM@OZ.EXAMPLE.COM FOZ.EXAMPLE.COM@EXAMPLE.COM A.FOZ.EXAMPLE.COM@FOZ.EXAMPLE.COM"
+eval $check
+
+#set EXAMPLE.COM EXAMPLE.COM "EXAMPLE.COM@EXAMPLE.COM"
+set EXAMPLE.COM EXAMPLE.COM ""
+echo Next test should return a cannot-find-ticket error...
+eval $check
+
+set A.B B.B "A.B@A.B B@A.B B.B@B"
+eval $check
+
+set AB.B B.B "AB.B@AB.B B@AB.B B.B@B"
+eval $check
+
+set A.B BA.B "A.B@A.B B@A.B BA.B@B"
+eval $check
+
+set EXAMPLE.COM A.EXAMPLE.COM "EXAMPLE.COM@EXAMPLE.COM A.EXAMPLE.COM@EXAMPLE.COM"
+eval $check
+
+set A.EXAMPLE.COM EXAMPLE.COM "A.EXAMPLE.COM@A.EXAMPLE.COM EXAMPLE.COM@A.EXAMPLE.COM"
+eval $check
+
+exit $err