Browse Source

Add an autopkgtest

Christoph Biedl 8 months ago
parent
commit
6ffcaa326b
3 changed files with 101 additions and 0 deletions
  1. 38 0
      debian/recreate-autopkgtest
  2. 6 0
      debian/tests/control
  3. 57 0
      debian/tests/run-testsuite

+ 38 - 0
debian/recreate-autopkgtest

@@ -0,0 +1,38 @@
+#!/bin/sh
+
+set -eu
+
+MAKEFILE='src/testsuite/Makefile.am'
+
+(
+    cat <<__EOS__
+#!/bin/sh
+
+set -eu
+set -x
+
+cd src/testsuite
+
+__EOS__
+
+    fgrep 'cp ../ngircd/ngircd' "$MAKEFILE" |
+    awk '{print "cp /usr/sbin/ngircd "$3}'
+
+    echo
+
+    fgrep 'ln -s $(srcdir)/tests.sh' "$MAKEFILE" |
+    awk '{print "ln -s tests.sh "$4}'
+
+    echo
+
+    echo 'for TEST in \\'
+    sed -n -e '/^TESTS/,/^$/p' <"$MAKEFILE" |
+    sed -e 's/^TESTS = / /' | grep '^\s' |
+    awk '{print "    "$1" \\"}'
+
+    cat <<__EOS__
+; do
+    ./\$TEST
+done
+__EOS__
+) >debian/tests/run-testsuite

+ 6 - 0
debian/tests/control

@@ -0,0 +1,6 @@
+Tests: run-testsuite
+Depends: @,
+    expect,
+    openssl,
+    telnet,
+Restrictions: allow-stderr

+ 57 - 0
debian/tests/run-testsuite

@@ -0,0 +1,57 @@
+#!/bin/sh
+
+set -eu
+set -x
+
+cd src/testsuite
+
+cp /usr/sbin/ngircd T-ngircd1
+cp /usr/sbin/ngircd T-ngircd2
+cp /usr/sbin/ngircd T-ngircd3
+
+ln -s tests.sh connect-test
+ln -s tests.sh connect-ssl-cert1-test
+ln -s tests.sh connect-ssl-cert2-test
+ln -s tests.sh channel-test
+ln -s tests.sh invite-test
+ln -s tests.sh join-test
+ln -s tests.sh kick-test
+ln -s tests.sh message-test
+ln -s tests.sh misc-test
+ln -s tests.sh mode-test
+ln -s tests.sh opless-channel-test
+ln -s tests.sh server-link-test
+ln -s tests.sh server-login-test
+ln -s tests.sh who-test
+ln -s tests.sh whois-test
+
+for TEST in \
+    start-server1 \
+    connect-test \
+    start-server2 \
+    channel-test \
+    invite-test \
+    join-test \
+    kick-test \
+    message-test \
+    misc-test \
+    mode-test \
+    opless-channel-test \
+    who-test \
+    whois-test \
+    server-link-test \
+    server-login-test \
+    stop-server2 \
+    stress-server.sh \
+    stop-server1 \
+    prep-server3 \
+    start-server3 \
+    connect-ssl-cert1-test \
+    switch-server3 \
+    reload-server3 \
+    connect-ssl-cert2-test \
+    cleanup-server3 \
+    stop-server3 \
+; do
+    ./$TEST
+done