_caldav__PROPFIND_ios (private)
_caldav__PROPFIND_ios
Defined in packages/caldav/tcl/test/caldav-test-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ set info [::caldav::test::basic_setup] set user_info [dict get $info user_info] try { # # Checks functionality of the CalDAV server # Example from https://github.com/seiyanuta/busybook/blob/master/Documentation/caldav-request-examples.md # set body_xml {<?xml version="1.0" encoding="UTF-8"?> <A:propfind xmlns:A="DAV:"> <A:prop> <B:calendar-home-set xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:calendar-user-address-set xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:current-user-principal/> <A:displayname/> <C:dropbox-home-URL xmlns:C="http://calendarserver.org/ns/"/> <C:email-address-set xmlns:C="http://calendarserver.org/ns/"/> <C:notification-URL xmlns:C="http://calendarserver.org/ns/"/> <A:principal-collection-set/> <A:principal-URL/> <A:resource-id/> <B:schedule-inbox-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:schedule-outbox-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:supported-report-set/> </A:prop> </A:propfind> } set d [::acs::test::http -user_info $user_info -method PROPFIND -headers {Content-Type text/xml} -body $body_xml /caldav] aa_equals "Status code valid" [dict get $d status] 207 set xml [dict get $d body] aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $xml]</pre>" ::caldav::test::foreach_response response $xml { ::acs::test::xpath::non_empty $response { d:href } ::acs::test::xpath::equals $response { d:href /caldav/ d:propstat/d:prop/d:current-user-principal /caldav/principal d:propstat/d:prop/d:displayname "" d:propstat/d:prop/d:principal-collection-set /caldav/principal d:propstat/d:prop/d:principal-URL /caldav/principal d:propstat/d:prop/d:supported-report-set "" } set principal_url [::acs::test::xpath::get_text $response d:propstat/d:prop/d:current-user-principal] } # # Principal query from iOS/11.2.6. # Note that the principal query for iOS ends with a "/" # set d [::acs::test::http -user_info $user_info -method OPTIONS $principal_url/] #ns_log notice "run returns $d" #ns_log notice "... [ns_set array [dict get $d headers]]" aa_equals "Status code valid" [dict get $d status] 200 aa_equals "Allowed: " [ns_set iget [dict get $d headers] Allow] "OPTIONS,GET,DELETE,PROPFIND,PUT,REPORT" set d [::acs::test::http -user_info $user_info -method PROPFIND -headers {Content-Type text/xml} -body {<?xml version="1.0" encoding="UTF-8"?> <A:propfind xmlns:A="DAV:"> <A:prop> <B:calendar-home-set xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:calendar-user-address-set xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:current-user-principal/> <A:displayname/> <C:dropbox-home-URL xmlns:C="http://calendarserver.org/ns/"/> <C:email-address-set xmlns:C="http://calendarserver.org/ns/"/> <C:notification-URL xmlns:C="http://calendarserver.org/ns/"/> <A:principal-collection-set/> <A:principal-URL/> <A:resource-id/> <B:schedule-inbox-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:schedule-outbox-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:supported-report-set/> </A:prop> </A:propfind> } $principal_url/] aa_equals "Status code valid" [dict get $d status] 207 set xml [dict get $d body] aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $xml]</pre>" ::caldav::test::foreach_response response $xml { ::acs::test::xpath::equals $response { d:propstat/d:prop/d:principal-URL /caldav/principal d:propstat/d:prop/c:calendar-home-set /caldav/calendar d:propstat/d:prop/d:resource-id "" } set calendar_url [::acs::test::xpath::get_text $response d:propstat/d:prop/c:calendar-home-set] } # # Calendar Query # set d [::acs::test::http -user_info $user_info -method PROPFIND -headers {Content-Type text/xml} -body {<?xml version="1.0" encoding="UTF-8"?> <A:propfind xmlns:A="DAV:"> <A:prop> <A:add-member/> <C:allowed-sharing-modes xmlns:C="http://calendarserver.org/ns/"/> <E:autoprovisioned xmlns:E="http://apple.com/ns/ical/"/> <F:bulk-requests xmlns:F="http://me.com/_namespace/"/> <B:calendar-alarm xmlns:B="urn:ietf:params:xml:ns:caldav"/> <E:calendar-color xmlns:E="http://apple.com/ns/ical/"/> <B:calendar-description xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:calendar-free-busy-set xmlns:B="urn:ietf:params:xml:ns:caldav"/> <E:calendar-order xmlns:E="http://apple.com/ns/ical/"/> <B:calendar-timezone xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:current-user-privilege-set/> <B:default-alarm-vevent-date xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:default-alarm-vevent-datetime xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:displayname/> <C:getctag xmlns:C="http://calendarserver.org/ns/"/> <E:language-code xmlns:E="http://apple.com/ns/ical/"/> <E:location-code xmlns:E="http://apple.com/ns/ical/"/> <A:owner/> <C:pre-publish-url xmlns:C="http://calendarserver.org/ns/"/> <C:publish-url xmlns:C="http://calendarserver.org/ns/"/> <C:push-transports xmlns:C="http://calendarserver.org/ns/"/> <C:pushkey xmlns:C="http://calendarserver.org/ns/"/> <A:quota-available-bytes/> <A:quota-used-bytes/> <E:refreshrate xmlns:E="http://apple.com/ns/ical/"/> <A:resource-id/> <A:resourcetype/> <B:schedule-calendar-transp xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:schedule-default-calendar-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/> <C:source xmlns:C="http://calendarserver.org/ns/"/> <C:subscribed-strip-alarms xmlns:C="http://calendarserver.org/ns/"/> <C:subscribed-strip-attachments xmlns:C="http://calendarserver.org/ns/"/> <C:subscribed-strip-todos xmlns:C="http://calendarserver.org/ns/"/> <B:supported-calendar-component-set xmlns:B="urn:ietf:params:xml:ns:caldav"/> <B:supported-calendar-component-sets xmlns:B="urn:ietf:params:xml:ns:caldav"/> <A:supported-report-set/> <A:sync-token/> </A:prop> </A:propfind> } $calendar_url] aa_equals "Status code valid" [dict get $d status] 207 set xml [dict get $d body] aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $xml]</pre>" ::caldav::test::foreach_response response $xml { ::acs::test::xpath::non_empty $response { d:href d:propstat/d:prop/d:displayname d:propstat/d:prop/cs:getctag d:propstat/d:prop/ical:calendar-color d:propstat/d:prop/c:calendar-description } ::acs::test::xpath::equals $response { d:href /caldav/calendar/ d:propstat/d:prop/ical:calendar-order 1 } } } on error {errorMsg} { aa_true "Error msg: $errorMsg" 0 } finally { #calendar::delete -calendar_id $temp_calendar_id } }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "PROPFIND_ios (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle