diff options
author | Aetf <aetf@unlimitedcodeworks.xyz> | 2019-12-17 00:49:58 +0300 |
---|---|---|
committer | Aetf <aetf@unlimitedcodeworks.xyz> | 2020-05-28 05:07:25 +0300 |
commit | 44779bc862d9219ac3ab1b8e4537ec4fbf8e4239 (patch) | |
tree | 3055cbeca457a8a0a3dd1b2aeea334ba79ece859 /tests/data | |
parent | af6493b07b5ca9fd01da8324f589eaf3fc0dd000 (diff) |
FdoSecrets: add unit tests
Diffstat (limited to 'tests/data')
6 files changed, 163 insertions, 0 deletions
diff --git a/tests/data/dbus/interfaces/org.freedesktop.Secret.Collection.xml b/tests/data/dbus/interfaces/org.freedesktop.Secret.Collection.xml new file mode 100644 index 000000000..3b5dd64fd --- /dev/null +++ b/tests/data/dbus/interfaces/org.freedesktop.Secret.Collection.xml @@ -0,0 +1,33 @@ +<interface name="org.freedesktop.Secret.Collection"> + <property name="Items" type="ao" access="read"/> + <property name="Label" type="s" access="readwrite"/> + <property name="Locked" type="b" access="read"/> + <property name="Created" type="t" access="read"/> + <property name="Modified" type="t" access="read"/> + <signal name="ItemCreated"> + <arg name="item" type="o" direction="out"/> + </signal> + <signal name="ItemDeleted"> + <arg name="item" type="o" direction="out"/> + </signal> + <signal name="ItemChanged"> + <arg name="item" type="o" direction="out"/> + </signal> + <method name="Delete"> + <arg type="o" direction="out"/> + </method> + <method name="SearchItems"> + <arg type="ao" direction="out"/> + <arg name="attributes" type="a{ss}" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="StringStringMap"/> + </method> + <method name="CreateItem"> + <arg type="o" direction="out"/> + <arg name="properties" type="a{sv}" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> + <arg name="secret" type="(oayays)" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="FdoSecrets::SecretStruct"/> + <arg name="replace" type="b" direction="in"/> + <arg name="prompt" type="o" direction="out"/> + </method> +</interface> diff --git a/tests/data/dbus/interfaces/org.freedesktop.Secret.Item.xml b/tests/data/dbus/interfaces/org.freedesktop.Secret.Item.xml new file mode 100644 index 000000000..d9c39a2e9 --- /dev/null +++ b/tests/data/dbus/interfaces/org.freedesktop.Secret.Item.xml @@ -0,0 +1,21 @@ +<interface name="org.freedesktop.Secret.Item"> + <property name="Locked" type="b" access="read"/> + <property name="Attributes" type="a{ss}" access="readwrite"> + <annotation name="org.qtproject.QtDBus.QtTypeName" value="StringStringMap"/> + </property> + <property name="Label" type="s" access="readwrite"/> + <property name="Created" type="t" access="read"/> + <property name="Modified" type="t" access="read"/> + <method name="Delete"> + <arg type="o" direction="out"/> + </method> + <method name="GetSecret"> + <arg type="(oayays)" direction="out"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="FdoSecrets::SecretStruct"/> + <arg name="session" type="o" direction="in"/> + </method> + <method name="SetSecret"> + <arg name="secret" type="(oayays)" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="FdoSecrets::SecretStruct"/> + </method> +</interface> diff --git a/tests/data/dbus/interfaces/org.freedesktop.Secret.Prompt.xml b/tests/data/dbus/interfaces/org.freedesktop.Secret.Prompt.xml new file mode 100644 index 000000000..92aa8df84 --- /dev/null +++ b/tests/data/dbus/interfaces/org.freedesktop.Secret.Prompt.xml @@ -0,0 +1,11 @@ +<interface name="org.freedesktop.Secret.Prompt"> + <signal name="Completed"> + <arg name="dismissed" type="b" direction="out"/> + <arg name="result" type="v" direction="out"/> + </signal> + <method name="Prompt"> + <arg name="windowId" type="s" direction="in"/> + </method> + <method name="Dismiss"> + </method> +</interface> diff --git a/tests/data/dbus/interfaces/org.freedesktop.Secret.Service.xml b/tests/data/dbus/interfaces/org.freedesktop.Secret.Service.xml new file mode 100644 index 000000000..40240bb43 --- /dev/null +++ b/tests/data/dbus/interfaces/org.freedesktop.Secret.Service.xml @@ -0,0 +1,55 @@ +<interface name="org.freedesktop.Secret.Service"> + <property name="Collections" type="ao" access="read"/> + <signal name="CollectionCreated"> + <arg name="collection" type="o" direction="out"/> + </signal> + <signal name="CollectionDeleted"> + <arg name="collection" type="o" direction="out"/> + </signal> + <signal name="CollectionChanged"> + <arg name="collection" type="o" direction="out"/> + </signal> + <method name="OpenSession"> + <arg type="v" direction="out"/> + <arg name="algorithm" type="s" direction="in"/> + <arg name="input" type="v" direction="in"/> + <arg name="result" type="o" direction="out"/> + </method> + <method name="CreateCollection"> + <arg type="o" direction="out"/> + <arg name="properties" type="a{sv}" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> + <arg name="alias" type="s" direction="in"/> + <arg name="prompt" type="o" direction="out"/> + </method> + <method name="SearchItems"> + <arg type="ao" direction="out"/> + <arg name="attributes" type="a{ss}" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="StringStringMap"/> + <arg name="locked" type="ao" direction="out"/> + </method> + <method name="Unlock"> + <arg type="ao" direction="out"/> + <arg name="paths" type="ao" direction="in"/> + <arg name="prompt" type="o" direction="out"/> + </method> + <method name="Lock"> + <arg type="ao" direction="out"/> + <arg name="paths" type="ao" direction="in"/> + <arg name="prompt" type="o" direction="out"/> + </method> + <method name="GetSecrets"> + <arg type="a{o(oayays)}" direction="out"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="ObjectPathSecretMap"/> + <arg name="items" type="ao" direction="in"/> + <arg name="session" type="o" direction="in"/> + </method> + <method name="ReadAlias"> + <arg type="o" direction="out"/> + <arg name="name" type="s" direction="in"/> + </method> + <method name="SetAlias"> + <arg name="name" type="s" direction="in"/> + <arg name="collection" type="o" direction="in"/> + </method> +</interface> diff --git a/tests/data/dbus/interfaces/org.freedesktop.Secret.Session.xml b/tests/data/dbus/interfaces/org.freedesktop.Secret.Session.xml new file mode 100644 index 000000000..7d358df7b --- /dev/null +++ b/tests/data/dbus/interfaces/org.freedesktop.Secret.Session.xml @@ -0,0 +1,4 @@ +<interface name="org.freedesktop.Secret.Session"> + <method name="Close"> + </method> +</interface> diff --git a/tests/data/dbus/session.conf b/tests/data/dbus/session.conf new file mode 100644 index 000000000..096da6d4c --- /dev/null +++ b/tests/data/dbus/session.conf @@ -0,0 +1,39 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <type>session</type> + <keep_umask/> + <listen>unix:tmpdir=/tmp</listen> + <auth>EXTERNAL</auth> + <standard_session_servicedirs /> + <policy context="default"> + <allow send_destination="*" eavesdrop="true"/> + <allow eavesdrop="true"/> + <allow own="*"/> + </policy> + <include ignore_missing="yes">/etc/dbus-1/session.conf</include> + <includedir>session.d</includedir> + <includedir>/etc/dbus-1/session.d</includedir> + <include ignore_missing="yes">/etc/dbus-1/session-local.conf</include> + <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include> + <limit name="max_incoming_bytes">1000000000</limit> + <limit name="max_incoming_unix_fds">250000000</limit> + <limit name="max_outgoing_bytes">1000000000</limit> + <limit name="max_outgoing_unix_fds">250000000</limit> + <limit name="max_message_size">1000000000</limit> + <limit name="auth_timeout">240000</limit> + <limit name="pending_fd_timeout">150000</limit> + <limit name="max_completed_connections">100000</limit> + <limit name="max_incomplete_connections">10000</limit> + <limit name="max_connections_per_user">100000</limit> + <limit name="max_pending_service_starts">10000</limit> + <limit name="max_names_per_connection">50000</limit> + <limit name="max_match_rules_per_connection">50000</limit> + <limit name="max_replies_per_connection">50000</limit> + <!-- The above is copied from session bus conf. + Our only intent here is to set a low service_start_timeout, + such that ctest can exit sooner when dbus-run-session is used + to launch tests and some service fails to start. + --> + <limit name="service_start_timeout">500</limit> +</busconfig> |