################################ # Test Cancel-My-Jobs # # 0. Get-Printer-Attributes to check for "Cancel-My-Jobs" # 1. Create a few jobs putting each in a "pending-held" state # 2. Perform a "Cancel-My-Jobs" operation # 3. Confirm that the jobs were all cancelled. # { NAME "I-29.1. Get-Printer-Attributes Operation (check operations-supported)" OPERATION Get-Printer-Attributes GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR name requesting-user-name $user ATTR keyword requested-attributes operations-supported STATUS successful-ok EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0005 # Create-Job EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0008 # Cancel-Job EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0009 # Get-Job-Attributes EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0039 # Cancel-My-Jobs EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x003b # Close-Job EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0039 DEFINE-MATCH HAS_CANCEL_MY_JOBS EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x003b DEFINE-MATCH HAS_CLOSE_JOB } { SKIP-IF-NOT-DEFINED HAS_CANCEL_MY_JOBS SKIP-IF-NOT-DEFINED HAS_CLOSE_JOB NAME "I-29.2. Create-Job operation to make Cancel My Jobs Test Job 1" OPERATION Create-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR name requesting-user-name $user ATTR name job-name "Cancel My Jobs Test Job 1" ATTR boolean ipp-attribute-fidelity false STATUS successful-ok STATUS server-error-job-canceled STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30 EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME" EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0 EXPECT job-id DEFINE-VALUE CLOSE_JOB_TEST_JOB_1_ID EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6 EXPECT ?job-state-message OF-TYPE text IN-GROUP job-attributes-tag EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag } { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_1_ID NAME "I-29.3. Close-Job Operation (Close-Job Test Job Name)" OPERATION Close-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_1_ID ATTR name requesting-user-name $user STATUS successful-ok STATUS server-error-job-canceled } # Test Get-Job-Attributes operation # # Required by: RFC 2911 section 3.3.4 { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_1_ID NAME "I-29.4. Get-Job-Attributes Operation" OPERATION Get-Job-Attributes GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_1_ID ATTR name requesting-user-name $user STATUS successful-ok } { SKIP-IF-NOT-DEFINED HAS_CANCEL_MY_JOBS SKIP-IF-NOT-DEFINED HAS_CLOSE_JOB NAME "I-29.5. Create-Job operation to make Cancel My Jobs Test Job 2" OPERATION Create-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR name requesting-user-name $user ATTR name job-name "Cancel My Jobs Test Job 2" ATTR boolean ipp-attribute-fidelity false STATUS successful-ok STATUS server-error-job-canceled STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30 EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME" EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0 EXPECT job-id DEFINE-VALUE CLOSE_JOB_TEST_JOB_2_ID EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6 EXPECT ?job-state-message OF-TYPE text IN-GROUP job-attributes-tag EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag } { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_2_ID NAME "I-29.6. Close-Job Operation (Close-Job Test Job Name)" OPERATION Close-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_2_ID ATTR name requesting-user-name $user STATUS successful-ok STATUS server-error-job-canceled } # Test Get-Job-Attributes operation # # Required by: RFC 2911 section 3.3.4 { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_2_ID NAME "I-29.7. Get-Job-Attributes Operation" OPERATION Get-Job-Attributes GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_2_ID ATTR name requesting-user-name $user STATUS successful-ok } { SKIP-IF-NOT-DEFINED HAS_CANCEL_MY_JOBS SKIP-IF-NOT-DEFINED HAS_CLOSE_JOB NAME "I-29.8. Create-Job operation to make Cancel My Jobs Test Job 2" OPERATION Create-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR name requesting-user-name $user ATTR name job-name "Cancel My Jobs Test Job 3" ATTR boolean ipp-attribute-fidelity false STATUS successful-ok STATUS server-error-job-canceled STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30 EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME" EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0 EXPECT job-id DEFINE-VALUE CLOSE_JOB_TEST_JOB_3_ID EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6 EXPECT ?job-state-message OF-TYPE text IN-GROUP job-attributes-tag EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag } { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_3_ID NAME "I-29.9. Close-Job Operation (Close-Job Test Job Name)" OPERATION Close-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_3_ID ATTR name requesting-user-name $user STATUS successful-ok STATUS server-error-job-canceled } # Test Get-Job-Attributes operation # # Required by: RFC 2911 section 3.3.4 { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_3_ID NAME "I-29.10. Get-Job-Attributes Operation" OPERATION Get-Job-Attributes GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_3_ID ATTR name requesting-user-name $user STATUS successful-ok } { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_1_ID SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_2_ID SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_3_ID NAME "I-29.11. Cancel-My-Jobs Operation (setup 1)" OPERATION Cancel-My-Jobs GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri # I don't know why, but if this line below is left in, what ipptool sends for the # value of $CLOSE_JOB_TEST_JOB_1_ID is always 0 (zero) and the test will fail with CUPS 2.1 # because job 0 is not a valid job ID ATTR integer job-ids $CLOSE_JOB_TEST_JOB_1_ID,$CLOSE_JOB_TEST_JOB_2_ID,$CLOSE_JOB_TEST_JOB_3_ID ATTR name requesting-user-name $user ATTR text message "IPP Everywhere Testing: Cancel My 3 Jobs, operator!" STATUS successful-ok STATUS server-error-job-canceled STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30 } # Try cancelling the jobs individually (they should all be gone) { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_1_ID NAME "I-29.12. Cancel-Job Operation cancel job 1" OPERATION Cancel-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_1_ID ATTR name requesting-user-name $user STATUS successful-ok STATUS client-error-not-possible } { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_1_ID NAME "I-29.13. Cancel-Job Operation cancel job 2" OPERATION Cancel-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_2_ID ATTR name requesting-user-name $user STATUS successful-ok STATUS client-error-not-possible } { SKIP-IF-NOT-DEFINED CLOSE_JOB_TEST_JOB_1_ID NAME "I-29.14. Cancel-Job Operation cancel job 3" OPERATION Cancel-Job GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR integer job-id $CLOSE_JOB_TEST_JOB_3_ID ATTR name requesting-user-name $user STATUS successful-ok STATUS client-error-not-possible }