source: mod_gnutls/test/newtest @ 05984a0

proxy-ticket
Last change on this file since 05984a0 was 05984a0, checked in by Fiona Klute <fiona.klute@…>, 8 months ago

Replace "runtests" with "runtest.py"

This is the next step from handling HTTP requests and responses in
Python. In particular error handling is a lot easier to do in Python
than using Bash trap functions.

  • Property mode set to 100755
File size: 893 bytes
RevLine 
[4b53371]1#!/bin/bash
2
3TEST_NAME="$1"
4
5confirmed=0
6
7while [ "$confirmed" -eq 0 ]; do
8
[dcaba46]9    if [ -z "${TEST_NAME}" ]; then
10        read -e -p "describe your new test briefly: " -i "$tname" TEST_NAME
11    fi
[4b53371]12
13    tname="${TEST_NAME// /_}"
[e78bc78]14    newnum="$(( $(ls -d tests/* | sed 's|^[^/]*/\([0-9]*\)_.*|\1|' | sort -n | tail -n 1 | sed s/^0//) + 1))"
15    newname="$(printf "%02d_%s" "${newnum}" "$tname")"
[4b53371]16
[dcaba46]17    read -p "your new test will be named tests/$newname. OK? [Y/n]"
[4b53371]18    if [ "$REPLY" == "" ] || [ "${REPLY/Y/y}" == "y" ]; then
19        confirmed=1
20    fi
21done
22
23cp -a tests/00_basic "tests/$newname"
24
[e78bc78]25# create run script for make check
26newscript="test-${newname}.bash"
[05984a0]27cat - >"${newscript}" <<EOF
28#!/bin/bash
29. \${srcdir}/netns_py.bash \${srcdir}/runtest.py --test-number ${newnum}
30EOF
[e78bc78]31chmod a+x "${newscript}"
32
33echo "You can now edit ${newname}."
34echo "When ready, add ${newscript} to TESTS in Makefile.am."
Note: See TracBrowser for help on using the repository browser.