add standalone_or_supervised routine, unconditionally called from inc/*

This commit is contained in:
George Danchev 2012-04-21 09:05:57 +00:00
parent ceeea85dbe
commit 7e00e567e0
2 changed files with 27 additions and 3 deletions

View File

@ -248,11 +248,18 @@ to the general options of the test suite:
Default 1. Setable to 0 by option -k.
SPECIFIC_HELP 0=normal operation, 1=print help text of script and exit 0
Default 0. Setable to 1 by option -h
Default 0. Setable to 1 by option -h.
RELENG_STANDALONE 0=standalone, 1=supervised by run_all_auto script.
RELENG_PARENT Name of the parent process.
The code piece inc/releng_getopts.inc defines the following functions
for use by the single tests:
standalone_or_supervised Initialize the running mode - standalone or
supervised by run_all_auto script.
print_help Prints the help text for general options.
check_for_xorriso [-x]

View File

@ -7,9 +7,25 @@ RELENG_XORRISO=0
SIMULATE_FAILURE=0
CLEANUP=1
SPECIFIC_HELP=0
START_DIR_DONT_CHANGE=`pwd`
GEN_DATA_DIR=releng_generated_data/${SELF}
RELENG_STANDALONE=1
RELENG_PARENT=`ps -p $PPID -o comm=`
#############################################
standalone_or_supervised() {
if test x"$RELENG_PARENT" = x"run_all_auto"
then
echo "${SELF}: Running Supervised by ${RELENG_PARENT}"
RELENG_STANDALONE=0
else
echo "${SELF}: Running Standalone"
RELENG_STANDALONE=1
fi
}
# Unconditionally initialize the invocation mode - standalone or supervised
standalone_or_supervised
#############################################
print_help() {
@ -27,10 +43,12 @@ General options:
EOF
}
#############################################
boldify() {
if which tput >/dev/null 2>&1; then tput smso; fi
}
#############################################
unboldify() {
if which tput >/dev/null 2>&1; then tput rmso; fi
}
@ -85,7 +103,6 @@ cleanup() {
}
#############################################
check_for_xorriso() {
# $1: if "-x" then check executability