Description
The accountsservice is a D-Bus service that provides information about available user accounts. It can be used by various components and applications to access and modify user account information.This test case ensures that the accountsservice
can effectively retrieve details about a user account using its D-Bus interface.
Setup
Ensure that accountsservice
is installed and running on your Fedora system. Have a test user account (e.g., testuser
) that you will use for this test case.
How to test
- Open a terminal.
- To get the object path for the user, execute the command:
dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.FindUserByName string:"testuser"
. Replacetestuser
with the name of your test user account. - Note down the returned object path (e.g.,
/org/freedesktop/Accounts/User1000
). - Now, to retrieve details about the user, execute:
dbus-send --system --print-reply --dest=org.freedesktop.Accounts [OBJECT_PATH] org.freedesktop.DBus.Properties.Get string:"org.freedesktop.Accounts.User" string:"RealName"
. Replace[OBJECT_PATH]
with the object path obtained in the previous step.
Expected Results
- The first command should return an object path associated with the test user account.
- The second command should return the real name associated with the user. This should match the real name set for the test user.
- No errors should be encountered during the process.
Optional
Optionally, explore other properties using the D-Bus interface of accountsservice
like "HomeDirectory", "Shell", etc. Test changing these values using the Set
method and verify they update correctly.