Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test suite: Add tests for undefined page range limits #208

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ CUPS v2.4-b1 (Pending)
`ListenBackLog`, `LPDConfigFile`, `KeepAliveTimeout`, `RIPCache`, and
`SMBConfigFile` directives in `cupsd.conf` and `cups-files.conf`.
- Stubbed out deprecated `httpMD5` functions.
- Add test for undefined page ranges during printing.


CUPS v2.3.3op2 (February 1, 2021)
Expand Down
24 changes: 24 additions & 0 deletions test/5.5-lp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,30 @@ else
fi
echo ""

echo "LP Page ranges Test - undefined low page limit"
echo ""
echo " lp -d Test1 -P -5 testfile.pdf"
$runcups $VALGRIND ../systemv/lp -d Test1 -P -5 ../examples/testfile.pdf 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""

echo "LP Page ranges Test - undefined upper page limit"
echo ""
echo " lp -d Test1 -P 5- -o job-sheets=classified,classified testfile.pdf"
$runcups $VALGRIND ../systemv/lp -d Test1 -P 5- ../examples/testfile.pdf 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""

echo "LP Flood Test ($1 times in parallel)"
echo ""
echo " lp -d Test1 testfile.jpg"
Expand Down
11 changes: 9 additions & 2 deletions test/run-stp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,10 @@ fi

# Pages printed on Test1 (within 1 page for timing-dependent cancel issues)
count=`$GREP '^Test1 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
expected=`expr $pjobs \* 2 + 34`
# expected numbers of pages from page ranges tests:
# - 5 pages for the job with a lower limit undefined (-5)
# - 4 pages for the job with a upper limit undefined (5-)
expected=`expr $pjobs \* 2 + 34 + 5 + 4`
expected2=`expr $expected + 2`
if test $count -lt $expected -a $count -gt $expected2; then
echo "FAIL: Printer 'Test1' produced $count page(s), expected $expected."
Expand Down Expand Up @@ -1040,9 +1043,13 @@ fi
# - 1 request for setting cupsSNMP/IPPSupplies to False - CUPS-Add-Modify-Printer
# - 1 request for deleting the queue - CUPS-Delete-Printer

# Number of requests related to undefined page range limits - total 4 in 'expected'
# 2 requests (Create-Job, Send-Document) * number of jobs (2 - one for undefined
# low limit, one for undefined upper limit)

# Requests logged
count=`wc -l $BASE/log/access_log | awk '{print $1}'`
expected=`expr 35 + 18 + 30 + $pjobs \* 8 + $pprinters \* $pjobs \* 4 + 2 + 2 + 5`
expected=`expr 35 + 18 + 30 + $pjobs \* 8 + $pprinters \* $pjobs \* 4 + 2 + 2 + 5 + 4`
if test $count != $expected; then
echo "FAIL: $count requests logged, expected $expected."
echo " <p>FAIL: $count requests logged, expected $expected.</p>" >>$strfile
Expand Down