summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2020-02-24 18:43:50 +0100
committerDidier Raboud <odyx@debian.org>2020-02-24 18:50:19 +0100
commit255a4768e25da94050bef1b3ff2e32ed7e7ce18e (patch)
tree16d8452fbf8de0f273ec27ff6062d85faaefcd40
parent2f2fa6952ec0fbdf2c81488076074934111478ac (diff)
CI Tests: filter stderr away from known errors
-rwxr-xr-xdebian/tests/cups-basiccommands13
1 files changed, 11 insertions, 2 deletions
diff --git a/debian/tests/cups-basiccommands b/debian/tests/cups-basiccommands
index ad6601c8c..158b8a4ec 100755
--- a/debian/tests/cups-basiccommands
+++ b/debian/tests/cups-basiccommands
@@ -2,6 +2,13 @@
set -e -u
+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
+}
+
# What follows is widely taken from https://src.fedoraproject.org/rpms/cups/blob/master/f/tests/basic-commands/runtest.sh , with small adaptations for Debian
# runtest.sh - basic commands
# Author: Yulia Kopkova <ykopkova@redhat.com>
@@ -31,23 +38,25 @@ TIMEOUT=30
TPRN1="test-printer1"
TPRN2="test-printer2"
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 || :
lpadmin -x $TPRN2 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
+lpadmin -p $TPRN1 -v file:/dev/null -E -m $ML 2> $STDERR_FILE; filter_stderr_from_file $STDERR_FILE
echo " - Set $TPRN1 default"
lpadmin -d $TPRN1
echo " - Create printer $TPRN2"
-lpadmin -p $TPRN2 -v file:/dev/null -E -m $ML
+lpadmin -p $TPRN2 -v file:/dev/null -E -m $ML 2> $STDERR_FILE; filter_stderr_from_file $STDERR_FILE
echo " - Print $FILEPDF with lp and default printer"
lp $FILEPDF
echo " - Print $FILEJPG with lp and $TPRN2"