File: web-test

package info (click to toggle)
html2ps 1.0b7-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,208 kB
  • sloc: perl: 4,539; tcl: 1,799; sh: 38; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
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
#!/bin/sh

set -eu

test_nginx() {
    STATUS_SKIP=77

    netstat --tcp -lnp | grep nginx | grep 80

    if [ "$?" != 0 ]; then
        echo "nginx is not listening at port TCP/80"
        echo "ending $0 with status $STATUS_SKIP"
        exit $STATUS_SKIP
    fi
}

web_test() {
    PSFILE="$AUTOPKGTEST_TMP/out.ps"

    html2ps http://localhost > $PSFILE 2>/dev/null

    if [ ! -s "$PSFILE" ]; then
        echo "ERROR on creating $PSFILE."
        exit 1
    fi
}

test_nginx
web_test

exit 0