providers:checkbox: Remove nonexisting dependency from some after-suspend jobs

These jobs were renamed and their names are variable, so we can't
express them in another job's depends: as that doesn't support
wildcards.

The easiest workaround at this point is to remove them from the
dependencies. THe consequence is that the affected jobs (after suspend)
will run even if their before-suspend counterpart failed. This doesn't
sound too critical though, as if they fail before suspend but pass after
suspend it may warrant a closer look.
"4f8aace providers:certification-client: Update whitelists to add card switching and tests for sec
17061d0 providers:checkbox: Added manual card switching prompt test


This should complete the hybrid graphics test suite, a simple manual test prompts the user to switch to the second card (if present), and after a restart the same set of tests run on card 1 should run on card 2.

 [r=apulido][bug=][author=roadmr]"
checkbox-gui: move save of reports to when the test run finishes
"providers:checkbox: Remove nonexisting dependency from some after-suspend jobs.
    
    These jobs were renamed and their names are variable, so we can't
    express them in another job's depends: as that doesn't support
    wildcards.
    
    The easiest workaround at this point is to remove them from the
    dependencies. THe consequence is that the affected jobs (after suspend)
    will run even if their before-suspend counterpart failed. This doesn't
    sound too critical though, as if they fail before suspend but pass after
    suspend it may warrant a closer look.
 [r=sylvain-pineau][bug=1314383][author=roadmr]"
plainbox:abc: add ISessionStateExporter interface

This is the same interface we de-facto implement already but now with
a public interface class for easier documentation access.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:exporter: fix PEP-8 issue

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:exporter: fix PEP-8 issue

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:exporter: make SessionStateExporterBase an ISessionStateExporter

We can drop the abstract dump() method because the docstring has moved
to the interface now.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: add SessionStorage.id

This new property serves as a simple identifier for sessions.
It is derived from the random session directory name.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: make SessionStorage.load_checkpoint() handle missing files

Previously the load_checkpoint() method would crash if the session file
does not exist. This can be the case before a first checkpoint is created.
In such cases we should simply treat that file as empty.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: refactor _restore_SessionState_metadata()

This patch changes the API of
SessionResumeHelper{1,2,3}_restore_SessionState_metadata() so that
the first argument is a metadata object rather than a session object.

In addition, each of the 1-2-3 format versions implementations of that
method are moved to separate mix-in class MetaDataHelper{1,2,3}MixIn.
The existing SessionResumeHelper{1,2,3} clasess are all made to inherit
from the mix in.

This effectively allows the mix-in classes to be used by another
piece of code that wants to resume the meta-data object alone, without
having to resume the whole session.

Existing tests are adjusted to pass 'session.metadata' instead
of 'session', to compensate for the change.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: create EnvelopeUnpackMixIn

This small patch creates a mix-in class with the unpack_envelope() method
out of the initial part of SessionResumeHelper.resume() so that the
envelope unpacking code can be shared with the upcoming session peek
code.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: add SessionPeekHelper

This small class implements a peek(data) method and can peek at the
meta-data part of a session without having to restore a full session
(or handle any consistency issues the session may experience).

The new helper is added to objects importable from plainbox.impl.session

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:exporter: make the xlsx exporter resilient to missing data

This patch changes a number of resource['foo'] to resource.get('foo') as
we cannot rely on any of the resource records to have any particular
value.

Fixes: https://bugs.launchpad.net/plainbox/+bug/1314794

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"automatic merge by tarmac [r=roadmr][bug=1314794][author=zkrynicki]"
Mount root by label

Instead of keeping a map of qemu disk types to /dev files, we can just mount by
label and let the initramfs detect which device file to use. This avoids having
to deal with differences between partitioned disks and unpartitioned disks,
as well as not having to predict the order in which the seed and root disks
get enumerated.
Add a rootdelay

I've determined experimentally that we need a rootdelay, at least on
armhf, in order to give time for the by-label symlinks to be available.
Migrate armhf to the virt model

ARM has moved from using vexpress-based models to the "virt" model for the
guests. This lets us use virtio. However, since we don't have PCI, this
is a different virtio disk type then used on x86, so I've added a new
VIRTIO_BLK disk type.

We also no longer need to specify a dtb.
plainbox:secure:plugins: add recursion support to FsPlugInCollection

This patch changes FsPlugInCollection to support recursive search for
files in a directory. Recursive search can be enabled by using passing
recursive=True to the initializer. By default the old behavior is used.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:secure:providers: look for jobs recursively

Fixes: https://bugs.launchpad.net/plainbox/+bug/1312650

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>