xref: /OK3568_Linux_fs/u-boot/test/py/README.md (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# U-Boot pytest suite
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun## Introduction
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunThis tool aims to test U-Boot by executing U-Boot shell commands using the
6*4882a593Smuzhiyunconsole interface. A single top-level script exists to execute or attach to the
7*4882a593SmuzhiyunU-Boot console, run the entire script of tests against it, and summarize the
8*4882a593Smuzhiyunresults. Advantages of this approach are:
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun- Testing is performed in the same way a user or script would interact with
11*4882a593Smuzhiyun  U-Boot; there can be no disconnect.
12*4882a593Smuzhiyun- There is no need to write or embed test-related code into U-Boot itself.
13*4882a593Smuzhiyun  It is asserted that writing test-related code in Python is simpler and more
14*4882a593Smuzhiyun  flexible that writing it all in C.
15*4882a593Smuzhiyun- It is reasonably simple to interact with U-Boot in this way.
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun## Requirements
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunThe test suite is implemented using pytest. Interaction with the U-Boot console
20*4882a593Smuzhiyuninvolves executing some binary and interacting with its stdin/stdout. You will
21*4882a593Smuzhiyunneed to implement various "hook" scripts that are called by the test suite at
22*4882a593Smuzhiyunthe appropriate time.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunOn Debian or Debian-like distributions, the following packages are required.
25*4882a593SmuzhiyunSimilar package names should exist in other distributions.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun| Package        | Version tested (Ubuntu 14.04) |
28*4882a593Smuzhiyun| -------------- | ----------------------------- |
29*4882a593Smuzhiyun| python         | 2.7.5-5ubuntu3                |
30*4882a593Smuzhiyun| python-pytest  | 2.5.1-1                       |
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunThe test script supports either:
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun- Executing a sandbox port of U-Boot on the local machine as a sub-process,
35*4882a593Smuzhiyun  and interacting with it over stdin/stdout.
36*4882a593Smuzhiyun- Executing an external "hook" scripts to flash a U-Boot binary onto a
37*4882a593Smuzhiyun  physical board, attach to the board's console stream, and reset the board.
38*4882a593Smuzhiyun  Further details are described later.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun### Using `virtualenv` to provide requirements
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunOlder distributions (e.g. Ubuntu 10.04) may not provide all the required
43*4882a593Smuzhiyunpackages, or may provide versions that are too old to run the test suite. One
44*4882a593Smuzhiyuncan use the Python `virtualenv` script to locally install more up-to-date
45*4882a593Smuzhiyunversions of the required packages without interfering with the OS installation.
46*4882a593SmuzhiyunFor example:
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun```bash
49*4882a593Smuzhiyun$ cd /path/to/u-boot
50*4882a593Smuzhiyun$ sudo apt-get install python python-virtualenv
51*4882a593Smuzhiyun$ virtualenv venv
52*4882a593Smuzhiyun$ . ./venv/bin/activate
53*4882a593Smuzhiyun$ pip install pytest
54*4882a593Smuzhiyun```
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun## Testing sandbox
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunTo run the testsuite on the sandbox port (U-Boot built as a native user-space
59*4882a593Smuzhiyunapplication), simply execute:
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun```
62*4882a593Smuzhiyun./test/py/test.py --bd sandbox --build
63*4882a593Smuzhiyun```
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunThe `--bd` option tells the test suite which board type is being tested. This
66*4882a593Smuzhiyunlets the test suite know which features the board has, and hence exactly what
67*4882a593Smuzhiyuncan be tested.
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunThe `--build` option tells U-Boot to compile U-Boot. Alternatively, you may
70*4882a593Smuzhiyunomit this option and build U-Boot yourself, in whatever way you choose, before
71*4882a593Smuzhiyunrunning the test script.
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunThe test script will attach to U-Boot, execute all valid tests for the board,
74*4882a593Smuzhiyunthen print a summary of the test process. A complete log of the test session
75*4882a593Smuzhiyunwill be written to `${build_dir}/test-log.html`. This is best viewed in a web
76*4882a593Smuzhiyunbrowser, but may be read directly as plain text, perhaps with the aid of the
77*4882a593Smuzhiyun`html2text` utility.
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun### Testing under a debugger
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunIf you need to run sandbox under a debugger, you may pass the command-line
82*4882a593Smuzhiyunoption `--gdbserver COMM`. This causes two things to happens:
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun- Instead of running U-Boot directly, it will be run under gdbserver, with
85*4882a593Smuzhiyun  debug communication via the channel `COMM`. You can attach a debugger to the
86*4882a593Smuzhiyun  sandbox process in order to debug it. See `man gdbserver` and the example
87*4882a593Smuzhiyun  below for details of valid values for `COMM`.
88*4882a593Smuzhiyun- All timeouts in tests are disabled, allowing U-Boot an arbitrary amount of
89*4882a593Smuzhiyun  time to execute commands. This is useful if U-Boot is stopped at a breakpoint
90*4882a593Smuzhiyun  during debugging.
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunA usage example is:
93*4882a593Smuzhiyun
94*4882a593SmuzhiyunWindow 1:
95*4882a593Smuzhiyun```shell
96*4882a593Smuzhiyun./test/py/test.py --bd sandbox --gdbserver localhost:1234
97*4882a593Smuzhiyun```
98*4882a593Smuzhiyun
99*4882a593SmuzhiyunWindow 2:
100*4882a593Smuzhiyun```shell
101*4882a593Smuzhiyungdb ./build-sandbox/u-boot -ex 'target remote localhost:1234'
102*4882a593Smuzhiyun```
103*4882a593Smuzhiyun
104*4882a593SmuzhiyunAlternatively, you could leave off the `-ex` option and type the command
105*4882a593Smuzhiyunmanually into gdb once it starts.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunYou can use any debugger you wish, so long as it speaks the gdb remote
108*4882a593Smuzhiyunprotocol, or any graphical wrapper around gdb.
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunSome tests deliberately cause the sandbox process to exit, e.g. to test the
111*4882a593Smuzhiyunreset command, or sandbox's CTRL-C handling. When this happens, you will need
112*4882a593Smuzhiyunto attach the debugger to the new sandbox instance. If these tests are not
113*4882a593Smuzhiyunrelevant to your debugging session, you can skip them using pytest's -k
114*4882a593Smuzhiyuncommand-line option; see the next section.
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun## Command-line options
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun- `--board-type`, `--bd`, `-B` set the type of the board to be tested. For
119*4882a593Smuzhiyun  example, `sandbox` or `seaboard`.
120*4882a593Smuzhiyun- `--board-identity`, `--id` set the identity of the board to be tested.
121*4882a593Smuzhiyun  This allows differentiation between multiple instances of the same type of
122*4882a593Smuzhiyun  physical board that are attached to the same host machine. This parameter is
123*4882a593Smuzhiyun  not interpreted by the test script in any way, but rather is simply passed
124*4882a593Smuzhiyun  to the hook scripts described below, and may be used in any site-specific
125*4882a593Smuzhiyun  way deemed necessary.
126*4882a593Smuzhiyun- `--build` indicates that the test script should compile U-Boot itself
127*4882a593Smuzhiyun  before running the tests. If using this option, make sure that any
128*4882a593Smuzhiyun  environment variables required by the build process are already set, such as
129*4882a593Smuzhiyun  `$CROSS_COMPILE`.
130*4882a593Smuzhiyun- `--build-dir` sets the directory containing the compiled U-Boot binaries.
131*4882a593Smuzhiyun  If omitted, this is `${source_dir}/build-${board_type}`.
132*4882a593Smuzhiyun- `--result-dir` sets the directory to write results, such as log files,
133*4882a593Smuzhiyun  into. If omitted, the build directory is used.
134*4882a593Smuzhiyun- `--persistent-data-dir` sets the directory used to store persistent test
135*4882a593Smuzhiyun  data. This is test data that may be re-used across test runs, such as file-
136*4882a593Smuzhiyun  system images.
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun`pytest` also implements a number of its own command-line options. Commonly used
139*4882a593Smuzhiyunoptions are mentioned below. Please see `pytest` documentation for complete
140*4882a593Smuzhiyundetails. Execute `py.test --version` for a brief summary. Note that U-Boot's
141*4882a593Smuzhiyuntest.py script passes all command-line arguments directly to `pytest` for
142*4882a593Smuzhiyunprocessing.
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun- `-k` selects which tests to run. The default is to run all known tests. This
145*4882a593Smuzhiyun  option takes a single argument which is used to filter test names. Simple
146*4882a593Smuzhiyun  logical operators are supported. For example:
147*4882a593Smuzhiyun  - `'ums'` runs only tests with "ums" in their name.
148*4882a593Smuzhiyun  - ``ut_dm'` runs only tests with "ut_dm" in their name. Note that in this
149*4882a593Smuzhiyun    case, "ut_dm" is a parameter to a test rather than the test name. The full
150*4882a593Smuzhiyun    test name is e.g. "test_ut[ut_dm_leak]".
151*4882a593Smuzhiyun  - `'not reset'` runs everything except tests with "reset" in their name.
152*4882a593Smuzhiyun  - `'ut or hush'` runs only tests with "ut" or "hush" in their name.
153*4882a593Smuzhiyun  - `'not (ut or hush)'` runs everything except tests with "ut" or "hush" in
154*4882a593Smuzhiyun    their name.
155*4882a593Smuzhiyun- `-s` prevents pytest from hiding a test's stdout. This allows you to see
156*4882a593Smuzhiyun  U-Boot's console log in real time on pytest's stdout.
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun## Testing real hardware
159*4882a593Smuzhiyun
160*4882a593SmuzhiyunThe tools and techniques used to interact with real hardware will vary
161*4882a593Smuzhiyunradically between different host and target systems, and the whims of the user.
162*4882a593SmuzhiyunFor this reason, the test suite does not attempt to directly interact with real
163*4882a593Smuzhiyunhardware in any way. Rather, it executes a standardized set of "hook" scripts
164*4882a593Smuzhiyunvia `$PATH`. These scripts implement certain actions on behalf of the test
165*4882a593Smuzhiyunsuite. This keeps the test suite simple and isolated from system variances
166*4882a593Smuzhiyununrelated to U-Boot features.
167*4882a593Smuzhiyun
168*4882a593Smuzhiyun### Hook scripts
169*4882a593Smuzhiyun
170*4882a593Smuzhiyun#### Environment variables
171*4882a593Smuzhiyun
172*4882a593SmuzhiyunThe following environment variables are set when running hook scripts:
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun- `UBOOT_BOARD_TYPE` the board type being tested.
175*4882a593Smuzhiyun- `UBOOT_BOARD_IDENTITY` the board identity being tested, or `na` if none was
176*4882a593Smuzhiyun  specified.
177*4882a593Smuzhiyun- `UBOOT_SOURCE_DIR` the U-Boot source directory.
178*4882a593Smuzhiyun- `UBOOT_TEST_PY_DIR` the full path to `test/py/` in the source directory.
179*4882a593Smuzhiyun- `UBOOT_BUILD_DIR` the U-Boot build directory.
180*4882a593Smuzhiyun- `UBOOT_RESULT_DIR` the test result directory.
181*4882a593Smuzhiyun- `UBOOT_PERSISTENT_DATA_DIR` the test peristent data directory.
182*4882a593Smuzhiyun
183*4882a593Smuzhiyun#### `u-boot-test-console`
184*4882a593Smuzhiyun
185*4882a593SmuzhiyunThis script provides access to the U-Boot console. The script's stdin/stdout
186*4882a593Smuzhiyunshould be connected to the board's console. This process should continue to run
187*4882a593Smuzhiyunindefinitely, until killed. The test suite will run this script in parallel
188*4882a593Smuzhiyunwith all other hooks.
189*4882a593Smuzhiyun
190*4882a593SmuzhiyunThis script may be implemented e.g. by exec()ing `cu`, `kermit`, `conmux`, etc.
191*4882a593Smuzhiyun
192*4882a593SmuzhiyunIf you are able to run U-Boot under a hardware simulator such as qemu, then
193*4882a593Smuzhiyunyou would likely spawn that simulator from this script. However, note that
194*4882a593Smuzhiyun`u-boot-test-reset` may be called multiple times per test script run, and must
195*4882a593Smuzhiyuncause U-Boot to start execution from scratch each time. Hopefully your
196*4882a593Smuzhiyunsimulator includes a virtual reset button! If not, you can launch the
197*4882a593Smuzhiyunsimulator from `u-boot-test-reset` instead, while arranging for this console
198*4882a593Smuzhiyunprocess to always communicate with the current simulator instance.
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun#### `u-boot-test-flash`
201*4882a593Smuzhiyun
202*4882a593SmuzhiyunPrior to running the test suite against a board, some arrangement must be made
203*4882a593Smuzhiyunso that the board executes the particular U-Boot binary to be tested. Often,
204*4882a593Smuzhiyunthis involves writing the U-Boot binary to the board's flash ROM. The test
205*4882a593Smuzhiyunsuite calls this hook script for that purpose.
206*4882a593Smuzhiyun
207*4882a593SmuzhiyunThis script should perform the entire flashing process synchronously; the
208*4882a593Smuzhiyunscript should only exit once flashing is complete, and a board reset will
209*4882a593Smuzhiyuncause the newly flashed U-Boot binary to be executed.
210*4882a593Smuzhiyun
211*4882a593SmuzhiyunIt is conceivable that this script will do nothing. This might be useful in
212*4882a593Smuzhiyunthe following cases:
213*4882a593Smuzhiyun
214*4882a593Smuzhiyun- Some other process has already written the desired U-Boot binary into the
215*4882a593Smuzhiyun  board's flash prior to running the test suite.
216*4882a593Smuzhiyun- The board allows U-Boot to be downloaded directly into RAM, and executed
217*4882a593Smuzhiyun  from there. Use of this feature will reduce wear on the board's flash, so
218*4882a593Smuzhiyun  may be preferable if available, and if cold boot testing of U-Boot is not
219*4882a593Smuzhiyun  required. If this feature is used, the `u-boot-test-reset` script should
220*4882a593Smuzhiyun  peform this download, since the board could conceivably be reset multiple
221*4882a593Smuzhiyun  times in a single test run.
222*4882a593Smuzhiyun
223*4882a593SmuzhiyunIt is up to the user to determine if those situations exist, and to code this
224*4882a593Smuzhiyunhook script appropriately.
225*4882a593Smuzhiyun
226*4882a593SmuzhiyunThis script will typically be implemented by calling out to some SoC- or
227*4882a593Smuzhiyunboard-specific vendor flashing utility.
228*4882a593Smuzhiyun
229*4882a593Smuzhiyun#### `u-boot-test-reset`
230*4882a593Smuzhiyun
231*4882a593SmuzhiyunWhenever the test suite needs to reset the target board, this script is
232*4882a593Smuzhiyunexecuted. This is guaranteed to happen at least once, prior to executing the
233*4882a593Smuzhiyunfirst test function. If any test fails, the test infra-structure will execute
234*4882a593Smuzhiyunthis script again to restore U-Boot to an operational state before running the
235*4882a593Smuzhiyunnext test function.
236*4882a593Smuzhiyun
237*4882a593SmuzhiyunThis script will likely be implemented by communicating with some form of
238*4882a593Smuzhiyunrelay or electronic switch attached to the board's reset signal.
239*4882a593Smuzhiyun
240*4882a593SmuzhiyunThe semantics of this script require that when it is executed, U-Boot will
241*4882a593Smuzhiyunstart running from scratch. If the U-Boot binary to be tested has been written
242*4882a593Smuzhiyunto flash, pulsing the board's reset signal is likely all this script need do.
243*4882a593SmuzhiyunHowever, in some scenarios, this script may perform other actions. For
244*4882a593Smuzhiyunexample, it may call out to some SoC- or board-specific vendor utility in order
245*4882a593Smuzhiyunto download the U-Boot binary directly into RAM and execute it. This would
246*4882a593Smuzhiyunavoid the need for `u-boot-test-flash` to actually write U-Boot to flash, thus
247*4882a593Smuzhiyunsaving wear on the flash chip(s).
248*4882a593Smuzhiyun
249*4882a593Smuzhiyun#### Examples
250*4882a593Smuzhiyun
251*4882a593Smuzhiyunhttps://github.com/swarren/uboot-test-hooks contains some working example hook
252*4882a593Smuzhiyunscripts, and may be useful as a reference when implementing hook scripts for
253*4882a593Smuzhiyunyour platform. These scripts are not considered part of U-Boot itself.
254*4882a593Smuzhiyun
255*4882a593Smuzhiyun### Board-type-specific configuration
256*4882a593Smuzhiyun
257*4882a593SmuzhiyunEach board has a different configuration and behaviour. Many of these
258*4882a593Smuzhiyundifferences can be automatically detected by parsing the `.config` file in the
259*4882a593Smuzhiyunbuild directory. However, some differences can't yet be handled automatically.
260*4882a593Smuzhiyun
261*4882a593SmuzhiyunFor each board, an optional Python module `u_boot_board_${board_type}` may exist
262*4882a593Smuzhiyunto provide board-specific information to the test script. Any global value
263*4882a593Smuzhiyundefined in these modules is available for use by any test function. The data
264*4882a593Smuzhiyuncontained in these scripts must be purely derived from U-Boot source code.
265*4882a593SmuzhiyunHence, these configuration files are part of the U-Boot source tree too.
266*4882a593Smuzhiyun
267*4882a593Smuzhiyun### Execution environment configuration
268*4882a593Smuzhiyun
269*4882a593SmuzhiyunEach user's hardware setup may enable testing different subsets of the features
270*4882a593Smuzhiyunimplemented by a particular board's configuration of U-Boot. For example, a
271*4882a593SmuzhiyunU-Boot configuration may support USB device mode and USB Mass Storage, but this
272*4882a593Smuzhiyuncan only be tested if a USB cable is connected between the board and the host
273*4882a593Smuzhiyunmachine running the test script.
274*4882a593Smuzhiyun
275*4882a593SmuzhiyunFor each board, optional Python modules `u_boot_boardenv_${board_type}` and
276*4882a593Smuzhiyun`u_boot_boardenv_${board_type}_${board_identity}` may exist to provide
277*4882a593Smuzhiyunboard-specific and board-identity-specific information to the test script. Any
278*4882a593Smuzhiyunglobal value defined in these modules is available for use by any test
279*4882a593Smuzhiyunfunction. The data contained in these is specific to a particular user's
280*4882a593Smuzhiyunhardware configuration. Hence, these configuration files are not part of the
281*4882a593SmuzhiyunU-Boot source tree, and should be installed outside of the source tree. Users
282*4882a593Smuzhiyunshould set `$PYTHONPATH` prior to running the test script to allow these
283*4882a593Smuzhiyunmodules to be loaded.
284*4882a593Smuzhiyun
285*4882a593Smuzhiyun### Board module parameter usage
286*4882a593Smuzhiyun
287*4882a593SmuzhiyunThe test scripts rely on the following variables being defined by the board
288*4882a593Smuzhiyunmodule:
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun- None at present.
291*4882a593Smuzhiyun
292*4882a593Smuzhiyun### U-Boot `.config` feature usage
293*4882a593Smuzhiyun
294*4882a593SmuzhiyunThe test scripts rely on various U-Boot `.config` features, either directly in
295*4882a593Smuzhiyunorder to test those features, or indirectly in order to query information from
296*4882a593Smuzhiyunthe running U-Boot instance in order to test other features.
297*4882a593Smuzhiyun
298*4882a593SmuzhiyunOne example is that testing of the `md` command requires knowledge of a RAM
299*4882a593Smuzhiyunaddress to use for the test. This data is parsed from the output of the
300*4882a593Smuzhiyun`bdinfo` command, and hence relies on CONFIG_CMD_BDI being enabled.
301*4882a593Smuzhiyun
302*4882a593SmuzhiyunFor a complete list of dependencies, please search the test scripts for
303*4882a593Smuzhiyuninstances of:
304*4882a593Smuzhiyun
305*4882a593Smuzhiyun- `buildconfig.get(...`
306*4882a593Smuzhiyun- `@pytest.mark.buildconfigspec(...`
307*4882a593Smuzhiyun
308*4882a593Smuzhiyun### Complete invocation example
309*4882a593Smuzhiyun
310*4882a593SmuzhiyunAssuming that you have installed the hook scripts into $HOME/ubtest/bin, and
311*4882a593Smuzhiyunany required environment configuration Python modules into $HOME/ubtest/py,
312*4882a593Smuzhiyunthen you would likely invoke the test script as follows:
313*4882a593Smuzhiyun
314*4882a593SmuzhiyunIf U-Boot has already been built:
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun```bash
317*4882a593SmuzhiyunPATH=$HOME/ubtest/bin:$PATH \
318*4882a593Smuzhiyun    PYTHONPATH=${HOME}/ubtest/py:${PYTHONPATH} \
319*4882a593Smuzhiyun    ./test/py/test.py --bd seaboard
320*4882a593Smuzhiyun```
321*4882a593Smuzhiyun
322*4882a593SmuzhiyunIf you want the test script to compile U-Boot for you too, then you likely
323*4882a593Smuzhiyunneed to set `$CROSS_COMPILE` to allow this, and invoke the test script as
324*4882a593Smuzhiyunfollow:
325*4882a593Smuzhiyun
326*4882a593Smuzhiyun```bash
327*4882a593SmuzhiyunCROSS_COMPILE=arm-none-eabi- \
328*4882a593Smuzhiyun    PATH=$HOME/ubtest/bin:$PATH \
329*4882a593Smuzhiyun    PYTHONPATH=${HOME}/ubtest/py:${PYTHONPATH} \
330*4882a593Smuzhiyun    ./test/py/test.py --bd seaboard --build
331*4882a593Smuzhiyun```
332*4882a593Smuzhiyun
333*4882a593Smuzhiyun## Writing tests
334*4882a593Smuzhiyun
335*4882a593SmuzhiyunPlease refer to the pytest documentation for details of writing pytest tests.
336*4882a593SmuzhiyunDetails specific to the U-Boot test suite are described below.
337*4882a593Smuzhiyun
338*4882a593SmuzhiyunA test fixture named `u_boot_console` should be used by each test function. This
339*4882a593Smuzhiyunprovides the means to interact with the U-Boot console, and retrieve board and
340*4882a593Smuzhiyunenvironment configuration information.
341*4882a593Smuzhiyun
342*4882a593SmuzhiyunThe function `u_boot_console.run_command()` executes a shell command on the
343*4882a593SmuzhiyunU-Boot console, and returns all output from that command. This allows
344*4882a593Smuzhiyunvalidation or interpretation of the command output. This function validates
345*4882a593Smuzhiyunthat certain strings are not seen on the U-Boot console. These include shell
346*4882a593Smuzhiyunerror messages and the U-Boot sign-on message (in order to detect unexpected
347*4882a593Smuzhiyunboard resets). See the source of `u_boot_console_base.py` for a complete list of
348*4882a593Smuzhiyun"bad" strings. Some test scenarios are expected to trigger these strings. Use
349*4882a593Smuzhiyun`u_boot_console.disable_check()` to temporarily disable checking for specific
350*4882a593Smuzhiyunstrings. See `test_unknown_cmd.py` for an example.
351*4882a593Smuzhiyun
352*4882a593SmuzhiyunBoard- and board-environment configuration values may be accessed as sub-fields
353*4882a593Smuzhiyunof the `u_boot_console.config` object, for example
354*4882a593Smuzhiyun`u_boot_console.config.ram_base`.
355*4882a593Smuzhiyun
356*4882a593SmuzhiyunBuild configuration values (from `.config`) may be accessed via the dictionary
357*4882a593Smuzhiyun`u_boot_console.config.buildconfig`, with keys equal to the Kconfig variable
358*4882a593Smuzhiyunnames.
359