File: testscripts

package info (click to toggle)
python-cups 2.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 456 kB
  • sloc: ansic: 8,288; python: 349; makefile: 46; sh: 30
file content (42 lines) | stat: -rwxr-xr-x 1,070 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
set -efu

filter_stderr_from_file() {
    cat $1 | \
        grep -v -E "lpadmin: (Raw queues|Printer drivers) are deprecated and will stop working in a future version of CUPS." \
        || true \
        1>&2
}

# Make sure we can print to Files
sed -e 's/^#.*FileDevice.*$/FileDevice Yes/g' -i /etc/cups/cups-files.conf
service cups restart

TPRN1="test-printer1"
ML="drv:///sample.drv/deskjet.ppd"
STDERR_FILE=`mktemp`

cleanup() {
    # Delete it
    echo -n " - Interrupted (or finished), delete test printers:"
    lpadmin -x $TPRN1 2>/dev/null || :
    rm -f $STDERR_FILE
    echo " done."
}

trap cleanup EXIT INT

echo " - Create printer $TPRN1"
lpadmin -p $TPRN1 -v file:/dev/null -E -m $ML 2> $STDERR_FILE; filter_stderr_from_file $STDERR_FILE

echo " - Now test python3-cups"

pys="$(py3versions -s)"

for py in $pys; do
       echo "=== $py ==="
       $py ./test.py 2>&1
       $py ./examples/cupstree.py 2>&1
       echo "# This one fails in autopkgtest, not in a VM, so run it, but ignore if it fails"
       $py ./test-enum.py 2>&1 || :
done