#!/bin/sh # # Test suite for various server functions. # # Written by Russ Allbery # Copyright 2006, 2007, 2009 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. . "$SOURCE/tap/libtap.sh" . "$SOURCE/tap/kerberos.sh" . "$SOURCE/tap/remctl.sh" cd "$BUILD" # Test setup. kerberos_setup if [ $? != 0 ] ; then skip_all "Kerberos tests not configured" else plan 6 fi remctl="$BUILD/../client/remctl" if [ ! -x "$remctl" ] ; then bail "can't locate remctl client binary" fi remctld_start "$BUILD/../server/remctld" "$SOURCE/data/conf-simple" # Run the tests. ok_program "file descriptors closed properly on server" 0 "Okay" \ "$remctl" -s "$principal" -p 14373 localhost test closed ok_program "server returns despite background process" 0 "Parent" \ "$remctl" -s "$principal" -p 14373 localhost test background ok_program "matching and argv passing for EMPTY" 0 "0" \ "$remctl" -s "$principal" -p 14373 localhost empty ok_program "...but the empty argument does not match" 255 "Unknown command" \ "$remctl" -s "$principal" -p 14373 localhost empty '' ok_program "wildcard matching for the command" 0 "hello world" \ "$remctl" -s "$principal" -p 14373 localhost foo bar ok_program "...but only matches that subcommand" 255 "Unknown command" \ "$remctl" -s "$principal" -p 14373 localhost foo baz # Clean up. if [ -f "$BUILD/data/cmd-background.pid" ] ; then kill `cat "$BUILD/data/cmd-background.pid"` rm -f "$BUILD/data/cmd-background.pid" fi remctld_stop kerberos_cleanup