From 8692d345980642132eefcf03c9f3cb072baf21ef Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 15 Jul 2008 23:57:03 +0000 Subject: [PATCH] r1926@ken-wireless: raeburn | 2008-07-15 16:49:17 -0400 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 | 1 + src/lib/krb5/krb/walktree-tests | 71 +++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 src/lib/krb5/krb/walktree-tests diff --git a/src/lib/krb5/krb/Makefile.in b/src/lib/krb5/krb/Makefile.in index 93d31db41..46a5363b6 100644 --- a/src/lib/krb5/krb/Makefile.in +++ b/src/lib/krb5/krb/Makefile.in @@ -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 index 000000000..99561c547 --- /dev/null +++ b/src/lib/krb5/krb/walktree-tests @@ -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 -- 2.26.2