diff options
author | Ken Raeburn <raeburn@mit.edu> | 2009-01-16 00:33:00 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2009-01-16 00:33:00 +0000 |
commit | 7d3309ce9f5b00807280fcf75b940491f541d8ed (patch) | |
tree | ca15a10ed3da9c7038307a645aabb63f069dafd2 /src/kadmin | |
parent | 06836322635cc2287afca3806ffb165792ef9ede (diff) | |
download | krb5-7d3309ce9f5b00807280fcf75b940491f541d8ed.tar.gz krb5-7d3309ce9f5b00807280fcf75b940491f541d8ed.tar.xz krb5-7d3309ce9f5b00807280fcf75b940491f541d8ed.zip |
Use valgrind in more cases if VALGRIND is set
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21754 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin')
-rw-r--r-- | src/kadmin/passwd/unit-test/Makefile.in | 4 | ||||
-rw-r--r-- | src/kadmin/passwd/unit-test/config/unix.exp | 41 |
2 files changed, 43 insertions, 2 deletions
diff --git a/src/kadmin/passwd/unit-test/Makefile.in b/src/kadmin/passwd/unit-test/Makefile.in index 969ee8207e..37dfaca33f 100644 --- a/src/kadmin/passwd/unit-test/Makefile.in +++ b/src/kadmin/passwd/unit-test/Makefile.in @@ -16,10 +16,10 @@ unit-test-body:: $(ENV_SETUP) $(RUNTEST) --tool kpasswd KPASSWD=../kpasswd \ KINIT=$(BUILDTOP)/clients/kinit/kinit \ KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \ - PRIOCNTL_HACK=@PRIOCNTL_HACK@ + PRIOCNTL_HACK=@PRIOCNTL_HACK@ VALGRIND="$(VALGRIND)" unit-test-setup:: - $(ENV_SETUP) $(START_SERVERS) + $(ENV_SETUP) $(VALGRIND) $(START_SERVERS) unit-test-cleanup:: $(ENV_SETUP) $(STOP_SERVERS) diff --git a/src/kadmin/passwd/unit-test/config/unix.exp b/src/kadmin/passwd/unit-test/config/unix.exp index bd8382e19e..479d772437 100644 --- a/src/kadmin/passwd/unit-test/config/unix.exp +++ b/src/kadmin/passwd/unit-test/config/unix.exp @@ -1,3 +1,44 @@ +if { [string length $VALGRIND] } { + rename spawn valgrind_aux_spawn + proc spawn { args } { + global VALGRIND + upvar 1 spawn_id spawn_id + set newargs {} + set inflags 1 + set eatnext 0 + foreach arg $args { + if { $arg == "-ignore" \ + || $arg == "-open" \ + || $arg == "-leaveopen" } { + lappend newargs $arg + set eatnext 1 + continue + } + if [string match "-*" $arg] { + lappend newargs $arg + continue + } + if { $eatnext } { + set eatnext 0 + lappend newargs $arg + continue + } + if { $inflags } { + set inflags 0 + # Only run valgrind for local programs, not + # system ones. +#&&![string match "/bin/sh" $arg] sh is used to start kadmind! + if [string match "/" [string index $arg 0]]&&![string match "/bin/ls" $arg]&&![regexp {/kshd$} $arg] { + set newargs [concat $newargs $VALGRIND] + } + } + lappend newargs $arg + } + set pid [eval valgrind_aux_spawn $newargs] + return $pid + } +} + # Hack around Solaris 9 kernel race condition that causes last output # from a pty to get dropped. if { $PRIOCNTL_HACK } { |