From Fedora Project Wiki

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

  1. Open a terminal.
  2. 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". Replace testuser with the name of your test user account.
  3. Note down the returned object path (e.g., /org/freedesktop/Accounts/User1000).
  4. 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

  1. The first command should return an object path associated with the test user account.
  2. The second command should return the real name associated with the user. This should match the real name set for the test user.
  3. 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.