Do not copy tests into /var/lib/utah/testsuites/, use a temp dir

Bug #1039540 reported by Max Brustkern
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UTAH
Triaged
Medium
Unassigned

Bug Description

When I provision a virtual machine and run the default runlist, I get this:
utah@utah-500-precise-i386:/var/lib/utah/testsuites/utah_tests/utah_tests$ utah -r /tmp/master.run
Traceback (most recent call last):
  File "/usr/bin/utah", line 138, in <module>
    main()
  File "/usr/bin/utah", line 123, in main
    runlist=runlist, resume=resume, testdir=testdir)
  File "/usr/lib/python2.7/dist-packages/utah/client/runner.py", line 154, in __init__
    self.process_master_runlist(resume=resume)
  File "/usr/lib/python2.7/dist-packages/utah/client/runner.py", line 382, in process_master_runlist
    shutil.rmtree(name)
  File "/usr/lib/python2.7/shutil.py", line 245, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 250, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/lib/python2.7/shutil.py", line 248, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: 'utah_tests/utah_tests/tslist.run'

Related branches

Changed in utah:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Javier Collado (javier.collado)
Changed in utah:
status: Triaged → In Progress
Changed in utah:
status: In Progress → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

To work around this, I did "sudo chmod -R g+ws /var/lib/utah/". However, that seems bad -- why does utah insist on copying the whole test and logs to /var/lib/utah? If you run a local file, everything is already there, and if you fetch stuff, I recommend to rather use a temporary dir than piling up all the bits in the utah user's home directory?

Revision history for this message
Javier Collado (javier.collado) wrote :

I certainly won't be against using temporary directories instead of using /var/lib/utah/testsuites.

Joe, what do you think about this? Why the design requires to have the test cases in a fixed location?

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

To elaborate on this: Without the setgid, running tests as different user (e. g. "ubuntu" in a live system or "martin" on my local workstation) is impossible; but I can't run desktop tests as "utah" user as that user does not have a running desktop session. With the setgid, running tests as different users is highly insecure, because anyone in the utah group can basically provide arbitrary code which then gets executed by other users.

I recommend to use temp dirs for anything you need to download, and the usual XDG dirs (in particular $HOME/.cache) for log files and the like. Then "utah -r" will work for the "utah" user just as well as for any other user.

Martin Pitt (pitti)
summary: - Default runlist fails
+ Do not copy tests into /var/lib/utah/testsuites/, use a temp dir
Changed in utah:
assignee: Javier Collado (javier.collado) → nobody
Revision history for this message
Max Brustkern (nuclearbob) wrote :

If this means a temp dir on a temporary filesystem, this will break reboot support. If we can create a temp dir that persists across reboots, we could make that work.

That being said, I think supporting running as different users is causing us more problems than the benefits we're getting from it, but that's mostly on the server side. I think we should discuss the need for continued support for users other than root and utah at some point.

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.