snaps tests assume ubuntu user

Bug #1643658 reported by Kyle Fazzari on 2016-11-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Low
Leo Arias

Bug Description

Trying to run the snaps tests locally results in an error as it assumes the user is named `ubuntu`. For example:

    $ ./runtests.sh snaps --filter hooks
    <snip>
    ======================================================================
    ERROR: demos_tests.test_hooks.HookCase.test_hooks
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/kyrofa/src/snapcraft/snaps_tests/demos_tests/test_hooks.py", line 26, in test_hooks
        self.install_snap(snap_path, 'hooks', '1.0')
      File "/home/kyrofa/src/snapcraft/snaps_tests/__init__.py", line 180, in install_snap
        self.snappy_testbed.copy_file(snap_local_path, '/home/ubuntu')
      File "/home/kyrofa/src/snapcraft/snaps_tests/testbed.py", line 49, in copy_file
        shutil.copy(src, dst)
      File "/usr/lib/python3.5/shutil.py", line 235, in copy
        copyfile(src, dst, follow_symlinks=follow_symlinks)
      File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
        with open(dst, 'wb') as fdst:
    PermissionError: [Errno 13] Permission denied: '/home/ubuntu'

It'd be great if this could be made a little more flexible.

Leo Arias (elopio) on 2017-01-06
Changed in snapcraft:
status: New → Triaged
tags: added: tests
tags: added: bitesize
Leo Arias (elopio) on 2017-01-24
Changed in snapcraft:
importance: Undecided → Low
assignee: nobody → Leo Arias (elopio)
status: Triaged → In Progress
Changed in snapcraft:
status: In Progress → Fix Committed
milestone: none → 2.26
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers