Merge ~sylvain-pineau/checkbox-ng:fix-1866597-bis into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: cfa6b81faa6599c5d65f0aca196b93c46708d976
Merged at revision: eaf74750708fafb7fa995991e0af457636a3a41b
Proposed branch: ~sylvain-pineau/checkbox-ng:fix-1866597-bis
Merge into: checkbox-ng:master
Diff against target: 22 lines (+4/-0)
1 file modified
plainbox/impl/session/remote_assistant.py (+4/-0)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+384713@code.launchpad.net

Description of the change

Fix the second half of the linked bug (see the last comments).

The normal_user special env var that I prepared for pm_test was not set when resuming sessions.

This patch reloads it from the session meta_data.

Tested with:

[launcher]
app_id = com.canonical.certification:checkbox-test
launcher_version = 1
stock_reports = text, submission_files

[test plan]
unit = com.canonical.certification::power-management-reboot-poweroff-cert-automated
forced = yes

[test selection]
forced = no

[ui]
output = hide-resource-and-attachment

[daemon]
normal_user = u

##################################""

==================================[ Results ]===================================
32.0kB [00:00, 378kB/s, file=python://stdout]
  job passed : Enumerate available system executables
  job passed : power-management/fwts_wakealarm
  job passed : power-management/poweroff
  job passed : power-management/poweroff-log-attach
  job passed : power-management/reboot
  job passed : power-management/reboot-log-attach

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Looks like a simple and clean fix to the problem at hand. Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/session/remote_assistant.py b/plainbox/impl/session/remote_assistant.py
2index be27c43..3220c3e 100644
3--- a/plainbox/impl/session/remote_assistant.py
4+++ b/plainbox/impl/session/remote_assistant.py
5@@ -614,6 +614,7 @@ class RemoteSessionAssistant():
6 return
7 _logger.warning("Resuming session: %r", session_id)
8 self._normal_user = self._launcher.normal_user
9+ _logger.info("normal_user: %r", self._normal_user)
10 pass_provider = (None if self._passwordless_sudo else
11 self.get_decrypted_password)
12 runner_kwargs = {
13@@ -627,6 +628,9 @@ class RemoteSessionAssistant():
14 launcher = app_blob['launcher']
15 self._launcher.read_string(launcher, False)
16 self._sa.use_alternate_configuration(self._launcher)
17+ self._normal_user = self._launcher.normal_user
18+ _logger.info(
19+ "normal_user after loading metadata: %r", self._normal_user)
20 test_plan_id = app_blob['testplan_id']
21 self._sa.select_test_plan(test_plan_id)
22 self._sa.bootstrap()

Subscribers

People subscribed via source and target branches