#!/usr/bin/bash

#
# Tell beakerlib what command to use to report results
#
. /usr/share/restraint/plugins/helpers

rstrnt_info "*** Running Plugin: $0"

export BEAKERLIB_COMMAND_REPORT_RESULT="/usr/bin/rstrnt-report-result --rhts"
export BEAKERLIB_COMMAND_SUBMIT_LOG=/usr/bin/rstrnt-report-log

# Don't run from PLUGINS
if [ -z "$RSTRNT_NOPLUGINS" ]; then
   if [ "$REBOOTCOUNT" = "0" -a -e "/var/tmp/beakerlib-$TESTID" ]; then
       rstrnt_debug "REBOOTCOUNT is 0 and /var/tmp/beakerlib-$TESTID exists. clearing..."
       rm -f /var/tmp/beakerlib-$TESTID/*
   fi
fi

exec "$@"
