@ bo29.test - Test plan Section 2.9: Cancel-Jobs (after submitting them) @ Version 1.6 @ Last revised by Xerox Corporation on 99-03-02. # Added NONSPOOLING conditional to submit one job at a time - TNH # Fixed title to show relationship to Test Plan - TNH # Remove Job Attributes returned in Cancel-Job - TNH # Use symbolic status codes - TNH # Copyright (c) 1999 by Xerox Corporation. All rights reserved. # User is granted the right to modify this file for use with # the IPP Server Test Tool, as described in the file # LICENSE-IppTest.txt. @ Pause the printer either using Pause-Printer or by local means. @ Keep the printer paused through the next 5 tests 2.9.1 - 2.9.5 Include pause-printer-somehow.test @ @ Section 2.9.1 - Submit then Cancel a pending job (while printer is paused) @ # no ipp-attribute-fidelity and # no Job Template attributes Print-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-name: 'Section 2.9.1 A Job', \ requesting-user-name: 'user 1', \ document-name: 'The File To Print', \ document-format: $requested-doc-format \ ) \ ), \ data: $test-print-file Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ Job: ( \ first-job-id = job-id: *, \ first-job-uri = job-uri: *, \ job-state: pending, \ ... \ ) \ ) @ Cancel-Job using the Printer-uri and job-id @ Cancel-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ ) \ ) Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ ) @ The former 'pending' job is NOW supposed to be canceled @ Now test that job $first-job-id is canceled @ Include BO29-A.test @ @ Section 2.9.2 - If Cancel-Job was successful, try to cancel the @ 'canceled' job again (while printer is paused). @ MUST be rejected with the status code: @ 'client-error-not-possible' (0x0404). @ If [$first-status-code: successful-ok] Cancel-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ ) \ ) Expect Response \ status-code: client-error-not-possible, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ ) EndIf @ @ The Cancel-Job of a canceled job MUST be rejected. @ Record the results and behavior in section 4.8. @ @ @ Section 2.9.3 - Submit then Cancel a pending job by job-URI @ (while printer is paused) @ # no ipp-attribute-fidelity and # no Job Template attributes IfDef NON-SPOOLING $prompt-to-accept-next-job-1 $prompt-to-accept-next-job-2 EndIf Print-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-name: 'Section 2.9.3 A Job', \ requesting-user-name: 'user 1', \ document-name: 'The File To Print', \ document-format: $requested-doc-format \ ) \ ), \ data: $test-print-file Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ Job: ( \ first-job-id = job-id: *, \ first-job-uri = job-uri: *, \ job-state: pending, \ ... \ ) \ ) @ Cancel-Job using the job-uri @ Cancel-Job \ target: $first-job-uri, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ job-uri: $first-job-uri, \ ) \ ) Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ ) @ The former pending job $first-job-uri MUST now be canceled @ Now test that job $first-job-uri is canceled @ Include BO29-A.test @ @ Section 2.9.4 If Cancel-Job was successful, try to cancel the @ canceled job again by job-uri (while printer is paused). @ MUST be rejected with the status code: @ client-error-not-possible (0x0404). @ If [$first-status-code: successful-ok] Cancel-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ job-uri: $first-job-uri, \ ) \ ) Expect Response \ status-code: client-error-not-possible, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ ) EndIf @ @ The Cancel-Job of a 'canceled' job MUST be rejected. @ Record the results and behavior in section 4.8. @ @ Section 2.9.5 - Submit (user 1) then Cancel a pending job @ canceled by a different user (user 2) (while printer is paused) @ # no ipp-attribute-fidelity and # no Job Template attributes IfDef NON-SPOOLING $prompt-to-accept-next-job-1 $prompt-to-accept-next-job-2 EndIf Print-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-name: 'Section 2.9.5 A Job', \ requesting-user-name: 'user 1', \ document-name: 'The File To Print', \ document-format: $requested-doc-format \ ) \ ), \ data: $test-print-file Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ Job: ( \ first-job-id = job-id: *, \ first-job-uri = job-uri: *, \ job-state: pending, \ ... \ ) \ ) @ Cancel-Job using the Printer-uri and job-id @ "requesting-user-name"='user 2' @ Cancel-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ requesting-user-name: 'user 2' \ ) \ ) @ The Cancel-Job MUST be rejected with the error status code: @ client-error-forbidden (0x0401), @ client-error-not-authenticated (0x0402), or @ client-error-not-authorized (0x0403) Expect Response \ status-code: client-error-forbidden | \ client-error-not-authenticated | \ client-error-not-authorized, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ) \ ) @ @ The Cancel-Job SHOULD be rejected, since not the owner @ Record the results and behavior in section 4.8. @ # Now resume the printer, so that it will start processing jobs. Include resume-printer-somehow.test @ @ Section 2.9.6 - Submit then attempt to Cancel a completed job by job-id. @ The Cancel-Job request MUST be rejected. @ # no ipp-attribute-fidelity and # no Job Template attributes IfDef NON-SPOOLING $prompt-to-accept-next-job-1 $prompt-to-accept-next-job-2 EndIf Print-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-name: 'Section 2.9.6 A Job', \ requesting-user-name: 'user 1', \ document-name: 'The File To Print', \ document-format: $requested-doc-format \ ) \ ), \ data: $test-print-file Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ Job: ( \ first-job-id = job-id: *, \ first-job-uri = job-uri: *, \ job-state: pending | processing, \ ... \ ) \ ) Echo Job $first-job-id has been submitted. Echo Type 'p' or 'P' when job $first-job-id has completed Read Symbol tmp p | P @ Cancel job $first-job-id using the Printer-uri and job-id @ It MUST be rejected (client-error-not-possible (0x0404) @ Cancel-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ ) \ ) Expect Response \ status-code: client-error-not-possible, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ) \ ) @ Now test that the completed job $first-job-id is still present and in the @ 'completed' state. @ Define Symbol expected-job-state completed Include check-job-state.test @ @ Section 2.9.7 - Submit then Cancel a processing job by job-id @ # no ipp-attribute-fidelity and # no Job Template attributes IfDef NON-SPOOLING $prompt-to-accept-next-job-1 $prompt-to-accept-next-job-2 EndIf Print-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-name: 'Section 2.9.7 A Job', \ requesting-user-name: 'user 1', \ document-name: 'The File To Print', \ document-format: $requested-doc-format \ ) \ ), \ data: $test-print-file Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ Job: ( \ first-job-id = job-id: *, \ first-job-uri = job-uri: *, \ job-state: pending | processing, \ ... \ ) \ ) Echo Job $first-job-id has been submitted. Echo Type 'p' or 'P' while the printer is printing job $first-job-id Read Symbol tmp p | P @ @ First check that job $first-job-id is in the processing state as requested. @ Get-Job-Attributes \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ requested-attributes: \ ) \ ) @ @ Check that job $first-job-id is in the processing state as requested. @ Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ), \ Job: ( \ job-id: $first-job-id, \ job-uri: $first-job-uri, \ job-state: processing, \ ), \ ) @ Now, cancel processing Job $first-job-id using the Printer-uri and job-id @ Cancel-Job \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ ) \ ) Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: *, \ ... \ ) \ ) @ Now test that job $first-job-id is canceled. @ Include BO29-A.test