process the case where the parent can't be find out, i.e. missing ps
This commit is contained in:
parent
a30b05dd70
commit
12e3fb0c76
@ -250,15 +250,16 @@ to the general options of the test suite:
|
|||||||
SPECIFIC_HELP 0=normal operation, 1=print help text of script and exit 0
|
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_STANDALONE 0=standalone, 1=supervised by run_all_auto script,
|
||||||
|
-1=undefined.
|
||||||
|
|
||||||
RELENG_PARENT Name of the parent process.
|
RELENG_PARENT Name of the parent process. Default: unknown_parent
|
||||||
|
|
||||||
The code piece inc/releng_getopts.inc defines the following functions
|
The code piece inc/releng_getopts.inc defines the following functions
|
||||||
for use by the single tests:
|
for use by the single tests:
|
||||||
|
|
||||||
standalone_or_supervised Initialize the running mode - standalone or
|
standalone_or_supervised Initialize the running mode - standalone,
|
||||||
supervised by run_all_auto script.
|
supervised by run_all_auto, or unknown.
|
||||||
|
|
||||||
print_help Prints the help text for general options.
|
print_help Prints the help text for general options.
|
||||||
|
|
||||||
|
@ -9,19 +9,31 @@ CLEANUP=1
|
|||||||
SPECIFIC_HELP=0
|
SPECIFIC_HELP=0
|
||||||
START_DIR_DONT_CHANGE=`pwd`
|
START_DIR_DONT_CHANGE=`pwd`
|
||||||
GEN_DATA_DIR=releng_generated_data/${SELF}
|
GEN_DATA_DIR=releng_generated_data/${SELF}
|
||||||
RELENG_STANDALONE=1
|
RELENG_STANDALONE=-1
|
||||||
RELENG_PARENT=`ps -p $PPID -o comm=`
|
RELENG_PARENT=unknown_parent
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
standalone_or_supervised() {
|
standalone_or_supervised() {
|
||||||
|
which ps >/dev/null 2>&1
|
||||||
|
ret="$?"
|
||||||
|
case "$ret" in
|
||||||
|
0)
|
||||||
|
RELENG_PARENT=`ps -p $PPID -o comm=`
|
||||||
if test x"$RELENG_PARENT" = x"run_all_auto"
|
if test x"$RELENG_PARENT" = x"run_all_auto"
|
||||||
then
|
then
|
||||||
echo "${SELF}: Running Supervised by ${RELENG_PARENT}"
|
echo "${SELF}: Running in Supervised mode by ${RELENG_PARENT}"
|
||||||
RELENG_STANDALONE=0
|
RELENG_STANDALONE=0
|
||||||
else
|
else
|
||||||
echo "${SELF}: Running Standalone"
|
echo "${SELF}: Running in Standalone mode"
|
||||||
RELENG_STANDALONE=1
|
RELENG_STANDALONE=1
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "${SELF}: Running in Unknown mode by ${RELENG_PARENT}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Unconditionally initialize the invocation mode - standalone or supervised
|
# Unconditionally initialize the invocation mode - standalone or supervised
|
||||||
|
Loading…
Reference in New Issue
Block a user