1#!/bin/sh 2# 3# Test the lpstat command. 4# 5# Copyright © 2020-2024 by OpenPrinting. 6# Copyright © 2007-2019 by Apple Inc. 7# Copyright © 1997-2005 by Easy Software Products, all rights reserved. 8# 9# Licensed under Apache License v2.0. See the file "LICENSE" for more 10# information. 11# 12 13echo "LPSTAT Basic Test" 14echo "" 15echo " lpstat -t" 16$runcups $VALGRIND ../systemv/lpstat -t 2>&1 17if test $? != 0; then 18 echo " FAILED" 19 exit 1 20else 21 echo " PASSED" 22fi 23echo "" 24 25echo "LPSTAT Enumeration Test" 26echo "" 27echo " lpstat -e" 28printers="`$runcups $VALGRIND ../systemv/lpstat -e 2>&1`" 29if test $? != 0 -o "x$printers" = x; then 30 echo " FAILED" 31 exit 1 32else 33 for printer in $printers; do 34 echo $printer 35 done 36 echo " PASSED" 37fi 38echo "" 39 40echo "LPSTAT Get Host Test" 41echo "" 42echo " lpstat -H" 43server="`$runcups $VALGRIND ../systemv/lpstat -H 2>&1`" 44if test $? != 0 -o "x$server" != x$CUPS_SERVER; then 45 echo " FAILED ($server)" 46 exit 1 47else 48 echo " PASSED ($server)" 49fi 50echo "" 51