summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2014-03-19run-test.sh: output in TAP format, and install an installed-tests wrapperSimon McVittie2-14/+33
See: https://wiki.gnome.org/action/show/Initiatives/GnomeGoals/InstalledTests https://en.wikipedia.org/wiki/Test_Anything_Protocol Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74626 Reviewed-by: Guillaume Desmottes
2014-02-06McdStorage: watch and proxy plugins' change-notification signalsSimon McVittie1-168/+36
This lets us get rid of the "ready" vfunc on plugins: we now connect to each plugin's signals only after we have called mcp_account_storage_list(), so we won't get double-notification for accounts that are both present in the initial list and signalled. This means we can remove a queue of delayed signal emissions from the test D-Bus plugin (and when it's ported to this API, from Empathy's libaccounts/UOA plugin). As far as I can see, list() and ready() happen within the same main-loop iteration anyway, so I don't think it was even possible to receive notification of a new account in that window. Empathy's GNOME Online Accounts plugin never really implemented this: in theory, it was incorrect, since any account that happened to be added between list() and ready() would be lost altogether. However, list() and ready() seem to happen in the same main-loop iteration, so this might never have been a practical concern. Rather than "fixing" Empathy's GOA plugin, it seems better to remove the difficult case altogether. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74581 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2014-02-04Opportunistically migrate accounts from untyped to typed ParametersSimon McVittie2-15/+24
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71093 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> [also depend on new tp-glib for tp_connection_manager_param_dup_variant_type -smcv]
2014-02-04mcp_account_storage_get_flags: addSimon McVittie1-0/+8
The initial flag is STORES_TYPES, which can be used to decide whether to try to attach types to untyped parameters. Of our built-in plugins, the default keyfile/variant-file storage and the D-Bus test plugin have STORES_TYPES, but the "diversion" plugin does not. Flags are account-specific in case they ever need to vary per-account (e.g. a FROM_TELEPATHY_0 flag might be one way to deal with migration from Telepathy 0.x to 1.0). Also add some convenience API (has_all_flags, has_any_flag) to make code that uses these flags easier to understand. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71093 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2014-02-04Require account plugins to provide the ability to list parametersSimon McVittie2-1/+102
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71093 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2014-02-03Remove A.I.ExternalPasswordStorage, CM.I.AccountStorageSimon McVittie1-9/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33485 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44512 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69600 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2014-01-29Test that we add types to accounts' parameters when setSimon McVittie1-3/+75
2014-01-29McdAccountManagerDefault: opportunistically save parameters' typesSimon McVittie1-4/+4
2014-01-29Only exercise old avatar storage locations in 5-12 and 5-14 testsSimon McVittie3-23/+33
Otherwise, it will reduce test coverage while porting to Telepathy 1.0: all the tests dealing with old locations need to be disabled until we implement 0.x -> 1.0 migration.
2014-01-29Chop up the increasingly inaccurately-named default-keyring-storage testSimon McVittie4-266/+340
This test hasn't dealt with a keyring for a while, and now only covers "variant files". Split it into two: one deals with creating an account at runtime in the default backend, and one deals with loading files from disk.
2014-01-29Add dedicated tests for keyfile-based storageSimon McVittie5-54/+213
These are impossible to test without restarting Mission Control, because we only read from one such location at a time; so there's no point in trying to bundle them into one test.
2014-01-29Be consistent in the constness of arguments in storage virtual methodsXavier Claessens2-19/+19
We usually don't pass const objects Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29mcp_account_storage_commit: guarantee that we commit one at a timeSimon McVittie2-34/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29delete_async: being asked to delete a nonexistent account is an errorSimon McVittie1-8/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29dbus-account-plugin: fail tests on various invalid method callsSimon McVittie1-16/+16
Methods that act on a single account should always be called on an account that exists (if it doesn't, where did you get its name from?), so treat it as an error if they are called with a nonexistent account. commit() has a dual role here: the method that takes a non-NULL account (which acts on a single account, as described), and the method that takes a NULL account name (which is OK to call at any time, to commit all of our 0-or-more accounts). While we are not active, we don't claim to have any accounts at all, so treat it as an error if any method is called with a non-NULL account name while inactive. I've temporarily made an exception for delete_async(), although that exception is removed in a later patch on this branch. It's less bad if delete_async() is called on an account that doesn't exist, because if you do, the desired state ("account X doesn't exist") has already been reached. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29dbus-account-plugin: fail tests if fake accounts service misbehavesSimon McVittie1-3/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29mc-debug-server: don't try to cope gracefully with a bad D-Bus connectionSimon McVittie1-28/+6
We know the regression tests are going to provide fake system and session buses. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29mcp_account_storage_delete_async: be cancellable, at least in theorySimon McVittie2-2/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29mcp_account_storage_get: replace with get_attribute, get_parameterSimon McVittie2-137/+97
The old API in which plugins poked new values into the McdStorage was non-obvious, and also fundamentally incompatible with the idea that each account is owned by at most one plugin: if an account in a high-priority plugin is masked by one in a low-priority plugin, the McdStorage can't prevent the low-priority plugin from changing its effective attribute and parameter values. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29dbus-account-plugin: update internal cache correctlySimon McVittie1-0/+1
The backend-makes-changes test replaces an typed parameter with an untyped parameter. We correctly signalled the change to MC, but didn't update the internal cache; the rather strange way in which MC receives attributes/parameters masked this bug. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29mcp_account_storage_set_*: return whether anything changedSimon McVittie2-15/+57
The plugins are better-placed to do this than McdStorage: they know their own storage format, after all. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29McdStorage: remove "owns" methodSimon McVittie1-17/+0
We now know whose account it is, without having to do this. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29Make mcp_account_storage_create() mandatorySimon McVittie1-0/+30
This means we can (finally) track which plugin "owns" which account in a reliable way. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29Make account deletion async (sort of), and imply a selective commitSimon McVittie2-84/+102
This means we don't need to commit separately after each deletion, and means account plugins don't have to have the concept of flagging an account for "delete this later" - much rejoicing. It also has the incidental benefit that we no longer use the C++ reserved word 'delete' in a header file. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29Call set_attribute, set_parameter to delete themSimon McVittie2-40/+53
It really doesn't make a great deal of sense to use the same callback to delete individual keys, and to delete accounts. McdAccountManagerDefault already dealt with that case, but the two test plugins didn't. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29Add some missing test coverage: IdentifyAccount failing hardSimon McVittie2-10/+39
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29mc-debug-server: don't exit when disconnected from system busSimon McVittie1-0/+14
The session bus is our fake system bus, too. We exit when libdbus tells us we have disconnected, and ignore both the possible ways in which GDBus can kill us, in order to get coverage stats. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
2014-01-29Remove mcp_account_storage_set()Simon McVittie2-20/+41
_set_attribute() and _set_parameter() are now mandatory for writable storage plugins. Note that most of the keyfile escaping code is still needed to help plugins to read their old keyfile values. [adjusted to apply earlier in the branch; left in the code that detects whether mcd_storage_set_parameter() is a no-op for an escaped parameter; took out mcp_account_storage_emit_created documentation fix -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71384 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-29McpAccountStorage: merge commit and commit_one into one functionSimon McVittie2-9/+13
Based on part of a patch by Xavier Claessens. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71384 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-29Remove all notion of secret parameterXavier Claessens1-21/+0
We now depend on SASLAuthentication for handling secret, and MC does not have gnome-keyring anymore. [Adjusted to apply before other storage API changes -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71384 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-07Remove BypassObservers supportSimon McVittie3-300/+1
It wasn't implemented correctly (see bug #40305) and I wasn't convinced by the design (see bug #30043). Let's think about it more before we bring it back. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30043 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40305 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2013-11-13Fix addition of restrictions to test accountsSimon McVittie1-1/+1
Account.restrictions wasn't initialized properly, so it would sometimes be nonzero, leading to mysterious test failures. Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71390
2013-11-12Revert "Simplify a bit storage API"Simon McVittie2-6/+24
This reverts commit 2da0807f7a4b6be29b980c95b888452f5a6ddc9b.
2013-11-12Revert "Rename commit_one() to commit()"Simon McVittie2-39/+39
This reverts commit b8617c51c1729e1579f9f066ead1fa80b0fd99a1.
2013-11-12Revert "Remove all notion of secret parameter"Simon McVittie1-0/+21
This reverts commit ae64063c953840f99b1204a222fabf5aa7a37b69.
2013-11-12Revert "Remove mcp_account_storage_set()"Simon McVittie2-41/+20
This reverts commit e9a9dd37bd193d8ac16729671d2296a4aa96139c.
2013-11-11Remove mcp_account_storage_set()Xavier Claessens2-20/+41
_set_attribute() and _set_parameter() are now mandatory for writable storage plugins. Note that most of the keyfile escaping code is still needed to help plugins to read their old keyfile values.
2013-11-08Remove all notion of secret parameterXavier Claessens1-21/+0
We now depend on SASLAuthentication for handling secret, and MC does not have gnome-keyring anymore.
2013-11-08Rename commit_one() to commit()Xavier Claessens2-39/+39
account_name==NULL still means to commit all.
2013-11-08Simplify a bit storage APIXavier Claessens2-24/+6
This is an API break, but we already did some since last release. This removes mcp_account_storage_commit() because it is redundant with mcp_account_storage_commit_one (plugin, am, NULL); This removes mcp_account_storage_owns() because an account is now owned by one and only one storage plugin and MC now keeps track of which storage plugin each account comes from. Finally this adds default implementation on most iface methods to make read-only plugins easier to implement. Only _get() and _list() and mandatory.
2013-11-08Allow backends, but not D-Bus clients, to delete restricted accountsSimon McVittie1-1/+21
I assumed that if TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED or TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PRESENCE, then a hypothetical CANNOT_DELETE flag would also have been present.
2013-11-08Replace McdAccount::always-on with the existing TpStorageRestrictionFlagsSimon McVittie6-15/+197
I used CANNOT_SET_PRESENCE to control access to ConnectAutomatically as well as the obvious AutomaticPresence and RequestedPresence, because RequestedPresence is not under the storage plugin's control - it is derived from ConnectAutomatically and AutomaticPresence at runtime. Use MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE as a way to bypass the storage restriction flags, so that storage plugins themselves can alter enabledness etc. even if they don't allow MC to change it. The regression test for this initially failed, because toggled_cb() did not pass that flag to the McdAccount: fix that too. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71390
2013-11-08fakeaccountsservice: be a bit more object-orientedSimon McVittie2-45/+61
2013-11-07Remove disabled regression test for the old libaccounts pluginSimon McVittie1-89/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71230 Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
2013-11-07Remove remnants of integration with Maemo MCESimon McVittie1-8/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71230 Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
2013-11-07Remove the Maemo libaccounts-sso pseudo-pluginSimon McVittie5-702/+0
The major user of libaccounts is Ubuntu Online Accounts, and we have a proper plugin for that in Empathy (with an Ubuntu-specific D-Bus API to fill in some gaps in the libaccounts API) and a request to merge that instead. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32904 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71230 Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
2013-10-31Default account storage backend: store parameters with types if possibleSimon McVittie1-4/+16
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54875 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2013-10-31Default accounts backend: store attributes in a properly typed formSimon McVittie1-10/+7
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54875 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2013-10-31Test some new corner cases in the default account storage backendSimon McVittie1-1/+64
Now that we can load individual accounts from any of several directories, we should test that precedence and deletion behave correctly. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54875 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2013-10-31Default account backend: store each account as a stringified GVariant in a fileSimon McVittie2-50/+62
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54875 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>