session:restart: Set up the systemd unit for all-snaps using sudo
Ubuntu Core 16 users have a sudoers configuration allowing sudo usage without
a password. Stress tests requiring a system restart had to run checkbox with
sudo to be able to set up the systemd unit, making all logs and report owned
by root (and saved in SNAP_DATA instead of SNAP_USER_DATA).
The new version takes advantage of this sudoer config by calling sudo from plainbox,
this allowing the whole session to be controlled by the user account.
The benefits are threefold, we stop using sudo to run stress tests, all logs
are easily accessible from SNAP_DATA and we don't need a specific snapcraft
launcher wrapper for stress tests.
Fix the differential execution environment on snappy to preserve python specific vars
On snappy (as of UC16), to run the bundled python3 interpreter and find the right
set of modules, snappy sets two env var, namely PYTHONHOME and PYTHONUSERBASE.
When the plainbox sudo controller computes the differential execution environment,
it needs to retain both in the final env.