Changeset 5d85ad3 in mod_gnutls
- Timestamp:
- Jul 23, 2015, 11:40:15 AM (6 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, master, proxy-ticket, upstream
- Children:
- dbec528
- Parents:
- 56056de
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/runtests
r56056de r5d85ad3 151 151 fi 152 152 153 for t in $testid; do 154 if [ -z "${flock_cmd}" ]; then 155 echo "Warning: no lock file set" 156 sleep "$TEST_GAP" 157 fi 158 t="$(realpath ${t})" 159 export srcdir="$(realpath ${srcdir})" 160 export TEST_NAME="$(basename "$t")" 161 output="outputs/${TEST_NAME}.output" 162 rm -f "$output" 163 164 if [ -e ${t}/fail.* ]; then 165 EXPECTED_FAILURE="$(printf " (expected: %s)" fail.*)" 166 else 167 unset EXPECTED_FAILURE 168 fi 169 printf "TESTING: %s%s\n" "$TEST_NAME" "$EXPECTED_FAILURE" 170 trap apache_down_err EXIT 171 if [ -n "${USE_MSVA}" ]; then 172 MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" \ 173 ${flock_cmd} \ 174 ${APACHE2} -f "${t}/apache.conf" -k start \ 175 || [ -e "${t}/fail.server" ] 176 else 177 ${flock_cmd} \ 178 ${APACHE2} -f "${t}/apache.conf" -k start \ 179 || [ -e "${t}/fail.server" ] 180 fi 181 182 # PID file for sleep command (explanation below) 183 sleep_pidfile="$(mktemp mod_gnutls_test-XXXXXX.pid)" 184 185 # The sleep call keeps the pipe from the subshell to gnutls-cli 186 # open. Without it gnutls-cli would terminate as soon as sed is 187 # done, and not wait for a response from the server, leading to 188 # failing tests. Sending sleep to the background allows the test 189 # case to proceed instead of waiting for it to return. The sleep 190 # process is stopped after gnutls-cli terminates. 191 if (sed "s/__HOSTNAME__/${TEST_HOST}/" <${t}/input && \ 192 run_with_pidfile "${sleep_pidfile}" sleep "${TEST_QUERY_DELAY}" &) | \ 193 gnutls-cli -p "${TEST_PORT}" $(cat ${t}/gnutls-cli.args) "${TEST_HOST}" \ 194 >"$output"; 195 then 196 if [ -e ${t}/fail* ]; then 197 printf "%s should have failed but succeeded\n" "$(basename "$t")" >&2 198 exit 1 199 fi 200 else 201 if [ ! -e ${t}/fail* ]; then 202 printf "%s should have succeeded but failed\n" "$(basename "$t")" >&2 203 exit 1 204 fi 205 fi 206 207 kill_by_pidfile "${sleep_pidfile}" 208 unset sleep_pidfile 209 210 if [ -e ${t}/output ] ; then 211 diff_output_filter_headers "${t}/output" "$output" "-q" 212 fi 213 if [ -n "${USE_MSVA}" ]; then 214 trap stop_msva EXIT 215 else 216 trap - EXIT 217 fi 218 ${APACHE2} -f "${t}/apache.conf" -k stop || [ -e ${t}/fail.server ] 219 printf "SUCCESS: %s\n" "$TEST_NAME" 220 done 153 if [ -z "${flock_cmd}" ]; then 154 echo "Warning: no lock file set" 155 sleep "$TEST_GAP" 156 fi 157 t="$(realpath ${testid})" 158 export srcdir="$(realpath ${srcdir})" 159 export TEST_NAME="$(basename "$t")" 160 output="outputs/${TEST_NAME}.output" 161 rm -f "$output" 162 163 if [ -e ${t}/fail.* ]; then 164 EXPECTED_FAILURE="$(printf " (expected: %s)" fail.*)" 165 else 166 unset EXPECTED_FAILURE 167 fi 168 printf "TESTING: %s%s\n" "$TEST_NAME" "$EXPECTED_FAILURE" 169 trap apache_down_err EXIT 170 if [ -n "${USE_MSVA}" ]; then 171 MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" \ 172 ${flock_cmd} \ 173 ${APACHE2} -f "${t}/apache.conf" -k start \ 174 || [ -e "${t}/fail.server" ] 175 else 176 ${flock_cmd} \ 177 ${APACHE2} -f "${t}/apache.conf" -k start \ 178 || [ -e "${t}/fail.server" ] 179 fi 180 181 # PID file for sleep command (explanation below) 182 sleep_pidfile="$(mktemp mod_gnutls_test-XXXXXX.pid)" 183 184 # The sleep call keeps the pipe from the subshell to gnutls-cli 185 # open. Without it gnutls-cli would terminate as soon as sed is 186 # done, and not wait for a response from the server, leading to 187 # failing tests. Sending sleep to the background allows the test 188 # case to proceed instead of waiting for it to return. The sleep 189 # process is stopped after gnutls-cli terminates. 190 if (sed "s/__HOSTNAME__/${TEST_HOST}/" <${t}/input && \ 191 run_with_pidfile "${sleep_pidfile}" sleep "${TEST_QUERY_DELAY}" &) | \ 192 gnutls-cli -p "${TEST_PORT}" $(cat ${t}/gnutls-cli.args) "${TEST_HOST}" \ 193 >"$output"; 194 then 195 if [ -e ${t}/fail* ]; then 196 printf "%s should have failed but succeeded\n" "$(basename "$t")" >&2 197 exit 1 198 fi 199 else 200 if [ ! -e ${t}/fail* ]; then 201 printf "%s should have succeeded but failed\n" "$(basename "$t")" >&2 202 exit 1 203 fi 204 fi 205 206 kill_by_pidfile "${sleep_pidfile}" 207 unset sleep_pidfile 208 209 if [ -e ${t}/output ] ; then 210 diff_output_filter_headers "${t}/output" "$output" "-q" 211 fi 212 if [ -n "${USE_MSVA}" ]; then 213 trap stop_msva EXIT 214 else 215 trap - EXIT 216 fi 217 ${APACHE2} -f "${t}/apache.conf" -k stop || [ -e ${t}/fail.server ] 218 printf "SUCCESS: %s\n" "$TEST_NAME" 221 219 222 220 if [ -n "${USE_MSVA}" ]; then
Note: See TracChangeset
for help on using the changeset viewer.