Merge ~sylvain-pineau/checkbox-ng:mini-me into checkbox-ng:remote-api-bump
Status: | Work in progress |
---|---|
Proposed branch: | ~sylvain-pineau/checkbox-ng:mini-me |
Merge into: | checkbox-ng:remote-api-bump |
Diff against target: |
481 lines (+366/-14) 6 files modified
checkbox_ng/launcher/checkbox_cli.py (+2/-0) checkbox_ng/launcher/mini_me.py (+327/-0) plainbox/impl/execution.py (+7/-0) plainbox/impl/session/assistant.py (+6/-0) plainbox/impl/session/remote_assistant.py (+23/-13) plainbox/impl/session/restart.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maciej Kisielewski (community) | Needs Fixing | ||
Taihsiang Ho | Pending | ||
Review via email:
|
Description of the change
the checkbox-cli mini-me command (see the commits for details)
How to test?
The standalone command (quick an easy):
$ checkbox-cli mini-me --host 192.168.1.33 com.canonical.
Nested inside an existing checkbox remote/service session:
1. Prepare the following launcher (adjust the target host ip of course):
[launcher]
app_id = com.canonical.
launcher_
stock_reports = text, submission_files
[test plan]
unit = com.canonical.
forced = yes
[test selection]
forced = yes
[ui]
output = hide-resource-
[environment]
STRESS_
STRESS_
STRESS_
TARGET_
2. A small test plan like this:
id: demo
unit: test plan
_name: demo tests
_description:
demo tests
include:
demo/
3. A demo job calling the new command:
plugin: shell
category_id: com.canonical.
id: demo/usb/detect
command:
checkbox-cli mini-me com.canonical.
_summary: Display USB devices attached to SUT
_description: Detects and shows USB devices attached to this system.
4. Install checkbox-ng and the checkbox provider from the dev ppa on a spare system
5. From your laptop, start a checkbox service (after adding the test plan and the new job to one of your local providers, side-loading one is a good idea):
sudo checkbox-cli service
6. Finally execute your launcher file with:
checkbox-cli master 127.0.0.1 ./mylauncher
If everything goes well, the usb/detect output should list devices from your spare system
Awesome stuff.
Is this based on remote-api-bump branch? There are some changes that landed there, and may conflict with this.
I think we need a way to mark session as a "mini-me" session. Reason is, if someone started a session with normal remote, connecting to it will result on MiniMe controller picking up the execution with no way of disconnecting (interrupt is bruteforce) and with different handling of things. MiniMe should be able to connect only to Idle services. And also it should have a global lock on the service (with a timeout) - those session should be short lived as I understand it. Also disconnecting controller should terminate this ephemeral session (Unless we want to support reboots as part of mini-me, but I doubt it, as we want this to be ephemeral, stateless thing.
There are a few bits below that need fixing, mostly because the new code is heavily based on existing controller.
Taking into consideration some of the things I noted here I think the whole thing can be greatly simplified.