Class attributes are as follows:
pscmd
:
Equals "ps -ef" if procps
is
installed in the image.
Otherwise, pscmd
equals
"ps" (busybox).
tc
:
The called text context, which gives access to the
following attributes:
d
:
The BitBake data store, 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.
qemu
:
Provides access to the
QemuRunner
object,
which is the class that boots the image.
The qemu
attribute
provides the following useful attributes:
ip
:
The machine's IP address.
host_ip
:
The host IP address, which is only
used by smart tests.
target
:
The SSHControl
object,
which is used for running the following
commands on the image:
host
:
Used internally.
The tests do not use this command.
timeout
:
A global timeout for commands run on
the target for the instance of a
test.
The default is 300 seconds.
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
.