users-admin not testable with ldtp and policykit

Bug #741186 reported by Patrick Wright
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ldtp (Ubuntu)
Triaged
Low
Unassigned
Natty
Won't Fix
Undecided
Unassigned
system-tools-backends (Ubuntu)
Triaged
Low
Unassigned
Natty
Won't Fix
High
Unassigned

Bug Description

Binary package hint: gnome-system-tools

While running an automated test, the tools hang when following these steps:

1. Open users-admin
2. Click Add (user)
* While trying to interact with authentication dialog, the scripts hang. This does not occur with the other apps we test that require authentication with polkit
Be patient for the timeout error dialog to display

Enable accessibility and install python-ldtp

Simple Test Script:

import ldtp
import sys

# must have a11y enabled
# arg1 is your password

password = sys.argv[1]

ldtp.launchapp('users-admin', delay=3)

ldtp.click('dlgUsersSettings', 'btnAdd')

dlgAuthenticate = 'dlgAthenticate'
ldtp.waittillguiexist(dlgAuthenticate)
ldtp.settextvalue(dlgAuthenticate, 'txtPassword', password)
ldtp.click(dlgAuthenticate, 'btnAuthenticate')

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: gnome-system-tools 2.32.0-0ubuntu6
ProcVersionSignature: Ubuntu 2.6.38-7.37-generic 2.6.38
Uname: Linux 2.6.38-7-generic i686
Architecture: i386
Date: Wed Mar 23 12:00:39 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110302)
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-system-tools
UpgradeStatus: Upgraded to natty on 2011-03-22 (1 days ago)

Revision history for this message
Patrick Wright (patrickmwright) wrote :
Changed in gnome-system-tools (Ubuntu):
importance: Undecided → High
description: updated
summary: - users-admin breaks with polkit
+ users-admin not testable with ldtp and policykit
description: updated
description: updated
Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

Yeah, this is because of the way the system-tools-backends and liboobs are designed: oobs_object_authenticate() is a synchronous call. I don't think this will be fixed since the gnome-system-tools are deprecated in favor of GNOME3's control center - unless you redesign the whole API *or* introduce a hack so that users-admin first authenticates via a direct call to PolicyKit (action org.freedesktop.systemtoolsbackends.set) from around src/user-settings.c:1050. But that would only work for that precise action and would be a ugly hack. Not sure it's worth it...

Easier would be to setup your test machine so that action org.freedesktop.systemtoolsbackends.set is allowed without authentication.

affects: gnome-system-tools (Ubuntu Natty) → system-tools-backends (Ubuntu Natty)
Revision history for this message
Patrick Wright (patrickmwright) wrote :

Milan,
Thank you for the explanation. Can you provide details as what to change in:
/usr/share/polkit-1/actions/org.freedesktop.SystemToolsBackends.policy

Which specific Defaults nodes/values to add/change?

Thanks!

Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

There aren't many actions in that file. You can just change "no" and "allow_admin_keep" for the org.freedesktop.systemtoolsbackends.set action to "yes", and manual authentication won't be required. The lines to edit are:
  <action id="org.freedesktop.systemtoolsbackends.set">
    <description gettext-domain="system-tools-backends">Manage system configuration</description>
    <message gettext-domain="system-tools-backends">You need to authenticate to modify the system configuration</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>

But this is assuming you can do that change only on trusted test machines or in virtual hosts, because it means any user will be able to run those actions, including changing the root password and things like that... :-(

Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

BTW, the official docs are at
http://hal.freedesktop.org/docs/polkit/polkit.8.html
or man polkit.

Revision history for this message
Martin Pitt (pitti) wrote :

Not a release critical bug at all, and dropping priority as this doesn't directly affect users and also is slowly getting obsoleted by new GNOME 3 technology.

Changed in system-tools-backends (Ubuntu Natty):
status: New → Won't Fix
Changed in system-tools-backends (Ubuntu):
importance: High → Low
status: New → Triaged
Changed in ldtp (Ubuntu Natty):
status: New → Won't Fix
Changed in ldtp (Ubuntu):
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.