plainbox:session: make SessionDeviceContext easier to import

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: allow apps to pass resume flags

This patch allows applications to pass resume flags via the
SessionManager.load_session() method. Flags are optional and default to
None. If flags are provided, they are propagated down the stack to
SessionResumeHelper and finally into SessionResumeHelper[1-4] classes.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:commands:session: remove unused imports

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:commands:session: allow 'session show' to resume any session

This patch adds two options to the 'plainbox session show'.
The '-r|--resume' option will enable attempts to resume each session
The '-f|--flag' option will pass resume flags to the resume code

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:resume: refactor helper decoder

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:resume: track session directory

This patch makes SessionResumeHelper track the location of the session
directyry. The location is taken from the SessionStorage object and
passed to the resume helper. This allows the resume helper to optionally
rewrite the location of each log file so that it is relative to the
actual location of the session file.
plainbox:session:resume: add 'file-reference-checks' flag

This patch adds a new, optional consistency check for the session resume
process. If the FLAG_FILE_REFERENCE_CHECKS flag is passed to the
SessionResumeHelper then log files are checked early to detect if they
exist or not.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:resume: add 'rewrite-log-pathnames' flag

This patch adds a new resume flag FLAG_REWRITE_LOG_PATHNAMES, that can
be used to control if the session log files are to be re-written if they
cannot be found at their nominal location. This can often happen while
moving session from machine to machine.

Note that to use this feature, the FLAG_FILE_REFERENCE_CHECKS flag must
be set as well, otherwise broken references are not detected and rewrite
logic is not active.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:resume: add 'ignore-job-checksums' flag

This patch adds the FLAG_IGNORE_JOB_CHECKSUMS session resume flag which
can be used to resume a session despite detected changes to job
definitions. The default behavior remains the strict, safe abort and
rejection to resume a session if any of its job definitions have
changed. For testing or debugging this is sometimes too strict so a less
rigid option is useful to have.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:resume: add extra debugging information

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
12.04.4 whitelist fix for usb3 superspeed test
"automatic merge of lp:~cypressyew/checkbox/12.04.4-usb3ss-list-fix/ by tarmac [r=sylvain-pineau][bug=1394881][author=cypressyew]"
"automatic merge of lp:~zkrynicki/checkbox/resume-flags/ by tarmac [r=sylvain-pineau][bug=][author=zkrynicki]"