Class attributes are as follows:
pscmd
:
Equals "ps -ef" if procps
is
installed in the image.
Otherwise, pscmd
equals
"ps" (busybox).
tc
:
The called test context, which gives access to the
following attributes:
d
:
The BitBake datastore, which allows you to
use stuff such as
oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager")
.
testslist
and testsrequired
:
Used internally.
The tests do not need these.
filesdir
:
The absolute path to
meta/lib/oeqa/runtime/files
,
which contains helper files for tests meant
for copying on the target such as small
files written in C for compilation.
target
:
The target controller object used to deploy
and start an image on a particular target
(e.g. QemuTarget, SimpleRemote, and
GummibootTarget).
Tests usually use the following:
ip
:
The target's IP address.
server_ip
:
The host's IP address, which is
usually used by the "smart" test
suite.
run(cmd, timeout=None)
:
The single, most used method.
This command is a wrapper for:
ssh root@host "cmd"
.
The command returns a tuple:
(status, output), which are what
their names imply - the return code
of "cmd" and whatever output
it produces.
The optional timeout argument
represents the number of seconds the
test should wait for "cmd" to
return.
If the argument is "None", the
test uses the default instance's
timeout period, which is 300
seconds.
If the argument is "0", the test
runs until the command returns.
copy_to(localpath, remotepath)
:
scp localpath root@ip:remotepath
.
copy_from(remotepath, localpath)
:
scp root@host:remotepath localpath
.