summaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-04-13 11:27:00 -0400
committerTom Rini <trini@konsulko.com>2020-04-13 11:27:00 -0400
commit891483186052b259852f3f48926ff307763f4eb0 (patch)
tree019e4a490e40ad5459f7dd3d4129021be696c495 /test/py
parent36fec02b1f90b92cf51ec531564f9284eae27ab4 (diff)
parent67bbc1ecd311c78b06e845a3fd4e333806782367 (diff)
Merge branch 'next'
Pull in changes that have been pending in our 'next' branch. This includes: - A large number of CI improvements including moving to gcc-9.2 for all platforms. - amlogic, xilinx, stm32, TI SoC updates - USB and i2c subsystem updtaes - Re-sync Kbuild/etc logic with v4.19 of the Linux kernel. - RSA key handling improvements
Diffstat (limited to 'test/py')
-rw-r--r--test/py/README.md13
-rw-r--r--test/py/conftest.py30
-rw-r--r--test/py/u_boot_utils.py7
3 files changed, 37 insertions, 13 deletions
diff --git a/test/py/README.md b/test/py/README.md
index 3cbe01b73e..2e5025258d 100644
--- a/test/py/README.md
+++ b/test/py/README.md
@@ -138,6 +138,9 @@ command-line option; see the next section.
before running the tests. If using this option, make sure that any
environment variables required by the build process are already set, such as
`$CROSS_COMPILE`.
+- `--buildman` indicates that `--build` should use buildman to build U-Boot.
+ There is no need to set $CROSS_COMPILE` in this case since buildman handles
+ it.
- `--build-dir` sets the directory containing the compiled U-Boot binaries.
If omitted, this is `${source_dir}/build-${board_type}`.
- `--result-dir` sets the directory to write results, such as log files,
@@ -333,7 +336,7 @@ PATH=$HOME/ubtest/bin:$PATH \
If you want the test script to compile U-Boot for you too, then you likely
need to set `$CROSS_COMPILE` to allow this, and invoke the test script as
-follow:
+follows:
```bash
CROSS_COMPILE=arm-none-eabi- \
@@ -342,6 +345,14 @@ CROSS_COMPILE=arm-none-eabi- \
./test/py/test.py --bd seaboard --build
```
+or, using buildman to handle it:
+
+```bash
+ PATH=$HOME/ubtest/bin:$PATH \
+ PYTHONPATH=${HOME}/ubtest/py/${HOSTNAME}:${PYTHONPATH} \
+ ./test/py/test.py --bd seaboard --build --buildman
+```
+
## Writing tests
Please refer to the pytest documentation for details of writing pytest tests.
diff --git a/test/py/conftest.py b/test/py/conftest.py
index 34ac4fb062..e3392ff6bc 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -70,6 +70,8 @@ def pytest_addoption(parser):
help='U-Boot board identity/instance')
parser.addoption('--build', default=False, action='store_true',
help='Compile U-Boot before running tests')
+ parser.addoption('--buildman', default=False, action='store_true',
+ help='Use buildman to build U-Boot (assuming --build is given)')
parser.addoption('--gdbserver', default=None,
help='Run sandbox under gdbserver. The argument is the channel '+
'over which gdbserver should communicate, e.g. localhost:1234')
@@ -140,16 +142,26 @@ def pytest_configure(config):
log = multiplexed_log.Logfile(result_dir + '/test-log.html')
if config.getoption('build'):
- if build_dir != source_dir:
- o_opt = 'O=%s' % build_dir
+ if config.getoption('buildman'):
+ if build_dir != source_dir:
+ dest_args = ['-o', build_dir, '-w']
+ else:
+ dest_args = ['-i']
+ cmds = (['buildman', '--board', board_type] + dest_args,)
+ name = 'buildman'
else:
- o_opt = ''
- cmds = (
- ['make', o_opt, '-s', board_type + '_defconfig'],
- ['make', o_opt, '-s', '-j8'],
- )
- with log.section('make'):
- runner = log.get_runner('make', sys.stdout)
+ if build_dir != source_dir:
+ o_opt = 'O=%s' % build_dir
+ else:
+ o_opt = ''
+ cmds = (
+ ['make', o_opt, '-s', board_type + '_defconfig'],
+ ['make', o_opt, '-s', '-j8'],
+ )
+ name = 'make'
+
+ with log.section(name):
+ runner = log.get_runner(name, sys.stdout)
for cmd in cmds:
runner.run(cmd, cwd=source_dir)
runner.close()
diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py
index bf2a0fc0e2..939d82eec1 100644
--- a/test/py/u_boot_utils.py
+++ b/test/py/u_boot_utils.py
@@ -237,10 +237,11 @@ def find_ram_base(u_boot_console):
raise Exception('Failed to find RAM bank start in `bdinfo`')
# We don't want ram_base to be zero as some functions test if the given
- # address is NULL (0). Let's add 2MiB then (size of an ARM LPAE/v8 section).
+ # address is NULL (0). Besides, on some RISC-V targets the low memory
+ # is protected that prevents S-mode U-Boot from access.
+ # Let's add 2MiB then (size of an ARM LPAE/v8 section).
- if ram_base == 0:
- ram_base += 1024 * 1024 * 2
+ ram_base += 1024 * 1024 * 2
return ram_base