tests.test_utils.TestSCUtils.test_safe_makedirs andtest_ensure_file_writable_and_delete_if_not fail to run if run as root

Bug #1042184 reported by Jean-Baptiste Lallement
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

autopkgtest runs adt-run as root.

The following tests fails when run as root because root as permission to do what would be denied to a normal user:
======================================================================
FAIL: test_ensure_file_writable_and_delete_if_not (tests.test_utils.TestSCUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_utils.py", line 196, in test_ensure_file_writable_and_delete_if_not
    self.assertFalse(os.access(test_file_not_writeable.name, os.W_OK))
AssertionError: True is not false

======================================================================
FAIL: test_safe_makedirs (tests.test_utils.TestSCUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_utils.py", line 221, in test_safe_makedirs
    self.assertRaises(OSError, safe_makedirs, target)
AssertionError: OSError not raised

----------------------------------------------------------------------

They should be skipped if run as root or change to another user. In the latter case, care must be taken that this test user as proper access to the source during the run (otherwise the run will hang)

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: software-center 5.3.9
ProcVersionSignature: Ubuntu 3.5.0-11.11-generic 3.5.2
Uname: Linux 3.5.0-11-generic x86_64
ApportVersion: 2.5.1-0ubuntu2
Architecture: amd64
Date: Mon Aug 27 12:45:25 2012
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: software-center
UpgradeStatus: Upgraded to quantal on 2012-01-31 (208 days ago)

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Same issue with test_logging

Revision history for this message
dino99 (9d9) wrote :

That version is no more maintained

Changed in software-center (Ubuntu):
status: New → Invalid
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.