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