2019-01-16 04:50:18 +00:00
|
|
|
|
NEW
|
2019-02-14 04:45:39 +00:00
|
|
|
|
PREFIX
|
2019-01-16 04:50:18 +00:00
|
|
|
|
AUTO 4,1
|
|
|
|
|
#!/BIN/SHELL
|
|
|
|
|
#
|
|
|
|
|
# BADSHTEST tests that the shell detects and properly handles
|
|
|
|
|
# (with error) an invalid shell script. It should return error
|
|
|
|
|
# F6/246. This script calls BADSCRIPT and checks for that code.
|
|
|
|
|
#
|
2019-02-14 04:45:39 +00:00
|
|
|
|
# We first need to check if this script is being called
|
|
|
|
|
# by BUILDTEST or if it is being run interactively.
|
|
|
|
|
#
|
|
|
|
|
IF [ -F ${ROOT}TMP/BUILDTEST ]
|
|
|
|
|
ELSE
|
|
|
|
|
SET B = 0
|
|
|
|
|
FI
|
|
|
|
|
#
|
2019-01-16 04:50:18 +00:00
|
|
|
|
echo "\n\nThis test will generate an error"
|
|
|
|
|
echo "between the lines. This is expected."
|
|
|
|
|
echo "---------------------------------------"
|
|
|
|
|
BADSCRIPT
|
|
|
|
|
SET R = $?
|
|
|
|
|
ECHO $R
|
|
|
|
|
echo "---------------------------------------"
|
|
|
|
|
IF [ $R -EQ 246 ]
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET P = $P + 1
|
2019-02-14 04:45:39 +00:00
|
|
|
|
echo "I am at AAAAAAA Pass with Log"
|
2019-01-16 04:50:18 +00:00
|
|
|
|
echo "BADSHTEST Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
echo "\nBADSHTEST Passed\n"
|
|
|
|
|
ELSE
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET F = $F + 1
|
2019-02-14 04:45:39 +00:00
|
|
|
|
echo "I am at BBBBBBB Fail with Log"
|
|
|
|
|
echo "BADSHTEST Failed - $R" >> ${Log}
|
2019-01-16 04:50:18 +00:00
|
|
|
|
FI
|
2019-02-14 04:45:39 +00:00
|
|
|
|
echo "\nBADSHTEST Failed - $R\n"
|
2019-01-16 04:50:18 +00:00
|
|
|
|
FI
|
|
|
|
|
MAN
|
2019-02-14 04:45:39 +00:00
|
|
|
|
TEXT /MAKE/USR/SHARE/TESTS/BADSHTEST
|