]> git.ipfire.org Git - thirdparty/cups.git/blob - test/5.5-lp.sh
94e2b3cb6e6220239ec9e718e05ba143773b1a5f
[thirdparty/cups.git] / test / 5.5-lp.sh
1 #!/bin/sh
2 #
3 # "$Id$"
4 #
5 # Test the lp command.
6 #
7 # Copyright 2007-2014 by Apple Inc.
8 # Copyright 1997-2005 by Easy Software Products, all rights reserved.
9 #
10 # These coded instructions, statements, and computer programs are the
11 # property of Apple Inc. and are protected by Federal copyright
12 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
13 # which should have been included with this file. If this file is
14 # file is missing or damaged, see the license at "http://www.cups.org/".
15 #
16
17 echo "LP Default Test"
18 echo ""
19 echo " lp testfile.pdf"
20 $VALGRIND ../systemv/lp testfile.pdf 2>&1
21 if test $? != 0; then
22 echo " FAILED"
23 exit 1
24 else
25 echo " PASSED"
26 fi
27 echo ""
28
29 echo "LP Destination Test"
30 echo ""
31 echo " lp -d Test3 -o fit-to-page testfile.jpg"
32 $VALGRIND ../systemv/lp -d Test3 -o fit-to-page testfile.jpg 2>&1
33 if test $? != 0; then
34 echo " FAILED"
35 exit 1
36 else
37 echo " PASSED"
38 fi
39 echo ""
40
41 echo "LP Options Test"
42 echo ""
43 echo " lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf"
44 $VALGRIND ../systemv/lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf 2>&1
45 if test $? != 0; then
46 echo " FAILED"
47 exit 1
48 else
49 echo " PASSED"
50 fi
51 echo ""
52
53 echo "LP Flood Test ($1 times in parallel)"
54 echo ""
55 echo " lp -d Test1 testfile.jpg"
56 echo " lp -d Test2 testfile.jpg"
57 i=0
58 pids=""
59 while test $i -lt $1; do
60 j=1
61 while test $j -le $2; do
62 $VALGRIND ../systemv/lp -d test-$j testfile.jpg 2>&1
63 j=`expr $j + 1`
64 done
65
66 $VALGRIND ../systemv/lp -d Test1 testfile.jpg 2>&1 &
67 pids="$pids $!"
68 $VALGRIND ../systemv/lp -d Test2 testfile.jpg 2>&1 &
69 pids="$pids $!"
70
71 i=`expr $i + 1`
72 done
73 wait $pids
74 if test $? != 0; then
75 echo " FAILED"
76 exit 1
77 else
78 echo " PASSED"
79 fi
80 echo ""
81
82 ./waitjobs.sh
83
84 echo "LPSTAT Completed Jobs Order Test"
85 echo ""
86 echo " lpstat -W completed -o"
87 $VALGRIND ../systemv/lpstat -W completed -o | tee $BASE/lpstat-completed.txt
88 if test "`uniq -d $BASE/lpstat-completed.txt`" != ""; then
89 echo " FAILED"
90 exit 1
91 else
92 echo " PASSED"
93 fi
94 echo ""
95
96
97 #
98 # End of "$Id$".
99 #