This repository has been archived by the owner on May 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
test.sh
153 lines (143 loc) · 3.79 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/sh
unalias rm
RM=`whereis rm|awk -F: '{print $2}'|awk '{print $1}'`
test -z "$RM" && RM=rm
${RM} test.log
touch test.log
PARMS="--disable-syslog --disable-logfile"
./configure $PARMS
if [ $? -eq 0 ]; then
echo "OK ./configure $PARMS" >> test.log
make clean
make
if [ $? -eq 0 ]; then
echo "OK make $PARMS" >> test.log
else
echo "FAIL make $PARMS" >> test.log
fi
else
echo "FAIL ./configure $PARMS" >> test.log
fi
PARMS="--disable-syslog"
./configure $PARMS
if [ $? -eq 0 ]; then
echo "OK ./configure $PARMS" >> test.log
make clean
make
if [ $? -eq 0 ]; then
echo "OK make $PARMS" >> test.log
src/rootsh -V | grep "syslog messages go to"
if [ $? -ne 0 ]; then
echo "OK switches $PARMS" >> test.log
else
echo "FAIL switches $PARMS" >> test.log
fi
else
echo "FAIL make $PARMS" >> test.log
fi
else
echo "FAIL ./configure $PARMS" >> test.log
fi
PARMS="--disable-logfile"
./configure $PARMS
if [ $? -eq 0 ]; then
echo "OK ./configure $PARMS" >> test.log
make clean
make
if [ $? -eq 0 ]; then
echo "OK make $PARMS" >> test.log
src/rootsh -V | grep "logfiles go to directory"
if [ $? -ne 0 ]; then
echo "OK switches $PARMS" >> test.log
else
echo "FAIL switches $PARMS" >> test.log
fi
else
echo "FAIL make $PARMS" >> test.log
fi
else
echo "FAIL ./configure $PARMS" >> test.log
fi
PARMS="--with-defaultshell=/bin/schmarrn"
./configure $PARMS
if [ $? -eq 0 ]; then
echo "OK ./configure $PARMS" >> test.log
make clean
make
if [ $? -eq 0 ]; then
echo "OK make $PARMS" >> test.log
src/rootsh -V | grep "schmarrn"
if [ $? -eq 0 ]; then
echo "OK switches $PARMS" >> test.log
else
echo "FAIL switches $PARMS" >> test.log
fi
else
echo "FAIL make $PARMS" >> test.log
fi
else
echo "FAIL ./configure $PARMS" >> test.log
fi
PARMS=""
./configure $PARMS
if [ $? -eq 0 ]; then
echo "OK ./configure $PARMS" >> test.log
make clean
make
if [ $? -eq 0 ]; then
echo "OK make $PARMS" >> test.log
${RM} -rf lolo*
src/rootsh -i --logfile=lolo -- ls -l test.sh
if { grep test.sh lolo.closed; }; then
echo "OK run simple" >> test.log
else
echo "FAIL run simple" >> test.log
fi
${RM} -rf lolo*
src/rootsh -i --logfile=lolo -- ${RM} lolo
if [ -f lolo.tampered ] && { grep DELETE lolo.tampered; }; then
echo "OK run tampered ${RM}" >> test.log
else
echo "FAIL run tampered ${RM}" >> test.log
fi
${RM} -rf lolo*
src/rootsh -i --logfile=lolo -- mv lolo lololo
if [ -f lolo.tampered ] && { grep DELETE lolo.tampered; }; then
echo "OK run tampered mv" >> test.log
else
echo "FAIL run tampered mv" >> test.log
fi
${RM} -rf lolo*
src/rootsh -i --logfile=lolo -- "${RM} lolo; touch lolo; touch lolo.tampered"
if [ -f lolo.tampered ] && { grep RECREATE lolo.tampered; }; then
echo "OK run tampered touch" >> test.log
else
echo "FAIL run tampered touch" >> test.log
fi
${RM} -rf lolo*
src/rootsh -i --logfile=lolo -- "${RM} lolo; mkdir lolo"
if [ -f lolo.tampered ] && { grep RECREATE lolo.tampered; }; then
echo "OK run tampered mkdir" >> test.log
else
echo "FAIL run tampered mkdir" >> test.log
fi
${RM} -rf lolo*
${RM} -rf *.closed
src/rootsh -i --logdir=. -- "env"
if [ -f *.closed ]; then
pid1=`ls *closed| awk -F. '{print $3}'`
pid2=`grep ROOTSH_SESSIONID *closed |sed -e 's/.*\[//g' -e 's/].*//g'`
if [ ! -z $pid1 ] && [ ! -z $pid2 ] && [ $pid1 = $pid2 ]; then
echo "OK run env" >> test.log
else
echo "FAIL run env" >> test.log
fi
else
echo "FAIL run env" >> test.log
fi
else
echo "FAIL make $PARMS" >> test.log
fi
else
echo "FAIL ./configure $PARMS" >> test.log
fi