When a test requires a package built by BitBake, it is possible
to install that package.
Installing the package does not require a package manager be
installed in the device under test (DUT).
It does, however, require an SSH connection and the target must
be using the sshcontrol
class.
scp
to copy files
from the host to the target, which causes permissions and
special attributes to be lost.
A JSON file is used to define the packages needed by a test.
This file must be in the same path as the file used to define
the tests.
Furthermore, the filename must map directly to the test
module name with a .json
extension.
The JSON file must include an object with the test name as keys of an object or an array. This object (or array of objects) uses the following data:
"pkg" - A mandatory string that is the name of the package to be installed.
"rm" - An optional boolean, which defaults to "false", that specifies to remove the package after the test.
"extract" - An optional boolean, which defaults to "false", that specifies if the package must be extracted from the package format. When set to "true", the package is not automatically installed into the DUT.
Following is an example JSON file that handles test "foo" installing package "bar" and test "foobar" installing packages "foo" and "bar". Once the test is complete, the packages are removed from the DUT.
{ "foo": { "pkg": "bar" }, "foobar": [ { "pkg": "foo", "rm": true }, { "pkg": "bar", "rm": true } ] }