Skip to content
Snippets Groups Projects
Commit af94c880 authored by Thomas Müller's avatar Thomas Müller
Browse files

Add CalDAVTester to travis

parent 960c8cb5
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,8 @@ matrix:
include:
- php: 5.4
env: DB=pgsql;TC=litmus-v1
- php: 5.4
env: DB=pgsql;TC=carddavtester
# - php: 5.4
# env: DB=mysql;TC=caldavtester
......
<!--
Copyright (c) 2006-2015 Apple Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!ELEMENT serverinfo (host, path, nonsslport, sslport, unix?,
host2?, nonsslport2?, sslport2?, unix2?,
authtype?, waitcount?, waitdelay?, waitsuccess?,
features?, substitutions)? >
<!ELEMENT host (#PCDATA)>
<!ELEMENT path (#PCDATA)>
<!ELEMENT nonsslport (#PCDATA)>
<!ELEMENT sslport (#PCDATA)>
<!ELEMENT unix (#PCDATA)>
<!ELEMENT host2 (#PCDATA)>
<!ELEMENT nonsslport2 (#PCDATA)>
<!ELEMENT sslport2 (#PCDATA)>
<!ELEMENT unix2 (#PCDATA)>
<!ELEMENT authtype (#PCDATA)>
<!ELEMENT waitdelay (#PCDATA)>
<!ELEMENT waitcount (#PCDATA)>
<!ELEMENT waitsuccess (#PCDATA)>
<!ELEMENT features (feature*)>
<!ELEMENT feature (#PCDATA)>
<!ELEMENT substitutions (substitution|repeat)*>
<!ELEMENT repeat (substitution+)>
<!ATTLIST repeat count CDATA "1">
<!ELEMENT substitution (key, value)>
<!ELEMENT key (#PCDATA)>
<!ELEMENT value (#PCDATA)>
This diff is collapsed.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
<!--
Copyright (c) 2006-2015 Apple Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<caldavtest>
<description>Test DAV:current-user-principal support</description>
<require-feature>
<feature>carddav</feature>
</require-feature>
<start/>
<test-suite name='Check for the property on /'>
<require-feature>
<feature>own-root</feature>
</require-feature>
<test name='1'>
<description>Check for authenticated property on /</description>
<request>
<method>PROPFIND</method>
<ruri>$root:</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CardDAV/vcurrent-user-principal/1.xml</filepath>
</data>
<verify>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value><![CDATA[{DAV:}current-user-principal$<D:href xmlns:D="DAV:">$principaluri1:</D:href>]]></value>
</arg>
</verify>
</request>
</test>
<test name='3'>
<description>Check for authenticated property on / (user02)</description>
<request user="$userid2:" pswd="$pswd2:">
<method>PROPFIND</method>
<ruri>$root:</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CardDAV/vcurrent-user-principal/1.xml</filepath>
</data>
<verify>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value><![CDATA[{DAV:}current-user-principal$<D:href xmlns:D="DAV:">$principaluri2:</D:href>]]></value>
</arg>
</verify>
</request>
</test>
</test-suite>
<test-suite name='Check for the property on /principals/'>
<test name='1'>
<description>Check for authenticated property on /</description>
<request>
<method>PROPFIND</method>
<ruri>$principalcollection:</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CardDAV/vcurrent-user-principal/1.xml</filepath>
</data>
<verify>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value><![CDATA[{DAV:}current-user-principal$<D:href xmlns:D="DAV:">$principaluri1:</D:href>]]></value>
</arg>
</verify>
</request>
</test>
<test name='2'>
<description>Check for unauthenticated property on /</description>
<request auth="no">
<method>PROPFIND</method>
<ruri>$principalcollection:</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CardDAV/vcurrent-user-principal/1.xml</filepath>
</data>
<verify>
<callback>statusCode</callback>
<arg>
<name>status</name>
<value>401</value>
</arg>
</verify>
</request>
</test>
<test name='3'>
<description>Check for authenticated property on / (user02)</description>
<request user="$userid2:" pswd="$pswd2:">
<method>PROPFIND</method>
<ruri>$principalcollection:</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CardDAV/vcurrent-user-principal/1.xml</filepath>
</data>
<verify>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value><![CDATA[{DAV:}current-user-principal$<D:href xmlns:D="DAV:">$principaluri2:</D:href>]]></value>
</arg>
</verify>
</request>
</test>
</test-suite>
<end/>
</caldavtest>
#!/usr/bin/env bash
SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT`
# start the server
php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." &
if [ ! -f CalDAVTester/run.py ]; then
cd "$SCRIPTPATH"
git clone https://github.com/DeepDiver1975/CalDAVTester.git
cd "$SCRIPTPATH/CalDAVTester"
python run.py -s
cd "$SCRIPTPATH"
fi
# create test user
cd "$SCRIPTPATH/../../../../"
OC_PASS=user01 php occ user:add --password-from-env user01
OC_PASS=user02 php occ user:add --password-from-env user02
cd "$SCRIPTPATH/../../../../"
# run the tests
cd "$SCRIPTPATH/CalDAVTester"
PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/caldavtest/config/serverinfo.xml" -o cdt.txt \
"$SCRIPTPATH/caldavtest/tests/CardDAV/current-user-principal.xml"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment