#!/bin/bash

. run_profile.txt
. $base_dir/plans/commands/common.fns

# Check needed vars from run_profile.txt
[ ! -d "$run_dir" ] && echo "ERROR: $run_dir does not exist" && exit -10

SUT=`hostname -s`
log_dir="$run_dir/test_output"
mkdir -p $log_dir

latest=`cat $PKGS_DIR/postmark/LATEST`
rcfile="$SRC_DIR/postmark-$latest/postmark.rc"
cmd="/usr/bin/time postmark $rcfile"
echo "using: $cmd"

# use $IOFILES for postmark files
IOFILES=/root/tmp
mkdir -p $IOFILES
cd $IOFILES

printenv PATH
export PATH=/usr/local/bin:$PATH

echo "Running postmark on SUT: $SUT"
# postmark parameters: all in postmark.rc

run_test "postmark" "$cmd" "$log_dir" "postmark.log"

# maybe print some selective log output:
# $all_pkgs_dir/posixtestsuite/posixtest-summary.sh

exit 0
