snaps tests assume ubuntu user

Bug #1643658 reported by Kyle Fazzari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
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.

Tags: bitesize tests
Leo Arias (elopio)
Changed in snapcraft:
status: New → Triaged
tags: added: tests
tags: added: bitesize
Leo Arias (elopio)
Changed in snapcraft:
importance: Undecided → Low
assignee: nobody → Leo Arias (elopio)
status: Triaged → In Progress
Revision history for this message
Leo Arias (elopio) wrote :
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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