2016-11-25 17:18:40 +01:00
|
|
|
#!/cmd/rc
|
|
|
|
|
|
|
|
# verify that rc scripts get the correct arguments
|
|
|
|
|
|
|
|
/qa/kern/args.rc.0 a b c
|
2017-10-22 13:22:37 +02:00
|
|
|
a0=`{echo $STATUS|awk '{print $3}'}
|
2016-11-25 17:18:40 +01:00
|
|
|
a0=$"a0 #"
|
|
|
|
|
|
|
|
/qa/kern/args.rc.1 a b c
|
2017-10-22 13:22:37 +02:00
|
|
|
a1=`{echo $STATUS|awk '{print $3}'}
|
2016-11-25 17:18:40 +01:00
|
|
|
a1=$"a1 #"
|
|
|
|
|
|
|
|
/qa/kern/args.rc.2 a b c
|
2017-10-22 13:22:37 +02:00
|
|
|
a2=`{echo $STATUS|awk '{print $3}'}
|
2016-11-25 17:18:40 +01:00
|
|
|
a2=$"a2 #"
|
|
|
|
|
|
|
|
/qa/kern/args.rc.0
|
2017-10-22 13:22:37 +02:00
|
|
|
b0=`{echo $STATUS|awk '{print $3}'}
|
2016-11-25 17:18:40 +01:00
|
|
|
b0=$"b0 #"
|
|
|
|
|
|
|
|
/qa/kern/args.rc.1
|
2017-10-22 13:22:37 +02:00
|
|
|
b1=`{echo $STATUS|awk '{print $3}'}
|
2016-11-25 17:18:40 +01:00
|
|
|
b1=$"b1 #"
|
|
|
|
|
|
|
|
/qa/kern/args.rc.2
|
2017-10-22 13:22:37 +02:00
|
|
|
b2=`{echo $STATUS|awk '{print $3}'}
|
2016-11-25 17:18:40 +01:00
|
|
|
b2=$"b2 #"
|
|
|
|
|
|
|
|
if (test -z $a0 || ! ~ $a0 /qa/kern/args.rc.0) {
|
|
|
|
echo FAIL: '$0' in '/qa/kern/args.rc.0 a b c' was $a0
|
|
|
|
exit FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
if (test -z $a1 || ! ~ $a1 a) {
|
|
|
|
echo FAIL: '$1' in '/qa/kern/args.rc.1 a b c' was $a1
|
|
|
|
exit FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
if (test -z $a2 || ! ~ $a2 b) {
|
|
|
|
echo FAIL: '$2' in '/qa/kern/args.rc.2 a b c' was $a2
|
|
|
|
exit FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
if (test -z $b0 || ! ~ $b0 /qa/kern/args.rc.0) {
|
|
|
|
echo FAIL: '$0' in '/qa/kern/args.rc.0' was $b0
|
|
|
|
exit FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
if (test -n $b1) {
|
|
|
|
echo FAIL: '$1' in '/qa/kern/args.rc.1' was $b1
|
|
|
|
exit FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
if (test -n $b2) {
|
|
|
|
echo FAIL: '$2' in '/qa/kern/args.rc.2' was $b2
|
|
|
|
exit FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
echo PASS
|
|
|
|
exit PASS
|