#!/bin/sh # # Test that we can retrieve the local username via the passwd file, # the Signature profile entry, and via SIGNATURE environment variable. # if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test unset SIGNATURE runtest() { testoutput=$(${MH_LIB_DIR}/ap -format "%(myname)" ignore) if [ x"$1" != x"${testoutput}" ]; then echo "For $2, expected $1 but got ${testoutput}" exit 1 fi } runtest "$(${MH_OBJ_DIR}/test/getfullname)" "GECOS field test" echo "Signature: Some Random Name 1" >> ${MH} runtest "Some Random Name 1" "MH Profile Signature test" export SIGNATURE="Some Random Name 2" runtest "${SIGNATURE}" "SIGNATURE Environment test" exit 0