Commit Graph

421 Commits

Author SHA1 Message Date
Kever Yang 9c7862b8bf test: storage: Fix board may not have devnum env
If the board do not have the 'devnum', the env_get() returns NULL
and strcmp will lead to "data abort".

Change-Id: I329237b61fc96bc90e7a07653b665192d6a9d7b8
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-09-24 14:27:38 +08:00
Kever Yang d0ff3d4548 rockchip: test: set argc to 1 for rktest all cmd
The 'rktest all v2/3' do not really pass arg to sub cmd, always set argc
for 'rktest all *' cmd to 1 for sub commands.

Change-Id: I2d69ad25aaca074f52bfd2e69be4c33bc41186df
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-09-24 14:27:38 +08:00
Kever Yang fb09b07158 test: rockchip: fix pointer for free()
free() is using pointer while sysmem_free() is not using pointer,
so they can not use the same parameter.

Change-Id: Ib68319bda2ba1a400f2436e21d5864a0e2511fad
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-21 09:55:21 +08:00
Kever Yang 21a92a158b rockchip: test: net: enable dhcp test with default value
1. add default dhcp cmd for test
2. fix the argc(has -1 in test-rockchip)
3. fix return value for FAIL case(return value is '1').

Change-Id: If55a3a8d29240be98febbf4649a23964a74452b6
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-20 20:45:34 +08:00
Kever Yang 54108d04ce rockchip: test: adapt for upstream U-Boot
Not test display and misc for upstream U-Boot, replace local APIs with
upstream APIs.
Use CONFIG_RKIMG_BOOTLOADER to identify the rockchip local U-Boot.

Change-Id: I65b69eca8262d8aa0cb621c90d4ff1f2756368ba
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-20 20:45:34 +08:00
Kever Yang bc18ede005 rockchip: test: use MACRO for module codes
Use module Macro for APIs from different module.

Change-Id: I765150f21bc9118e5ad0e661bb2b4ae12af77342
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-20 17:35:39 +08:00
Kever Yang e80ec83d32 rockchip: test: add usb disk test
Add support to test usb disk like other blk device,
update api to get correct blk_desc.

Change-Id: I6b9cbce42ef16f207ad9d41ca55fa0e58f273ec7
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-13 10:33:44 +08:00
Joseph Chen 443feaabc1 rockchip: test: add failed message for all cases
Failed message with prefix: "[UT-ERROR]: ..."

Change-Id: If44c174fc5e929d154851b4e2bf003c8a666f8b2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 14:57:09 +08:00
Joseph Chen 474718ff26 rockchip: test: storage: do not support user param
Default test case is enough.

Change-Id: Ic3627efc7b1cacd8b86d8303daa26af1f7fd32e7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 14:57:09 +08:00
Kever Yang 2a77afce30 rockchip: test: add log message need by LAVA
The LAVA system need message from log to show the test result.
"<LAVA_SIGNAL_*>" for start, end, test case result key;
"<LAVA_TEST_RUNNER>: exiting" for test complete key

Change-Id: I13522bf82da69f105f439853fa5c4b32c9f3d1ff
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-06 10:45:05 +08:00
Joseph Chen 99d14b019e test: rockchip: refactor framework and update test case
Change-Id: I8406aaa6c4eacf2b2eb0fa6d787e2a46f45c8049
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-06 10:23:50 +08:00
Simon Glass b6e92505d5 UPSTREAM: sf: Add a method to obtain the block-protect setting
It is useful to obtain the block-protect setting of the SPI flash, so we
know whether it is fully open or (perhaps partially) write-protected. Add
a method for this. Update the sandbox driver to process this operation and
add a test.

Signed-off-by: Simon Glass <sjg@chromium.org
Change-Id: I8e8abe197ab483a26622f02666cc234a1544e642
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a58986ca8b53d8c7a441397082f84edc7f47d19f)
2019-07-05 19:33:46 +08:00
Simon Glass 4d9cacbffa UPSTREAM: dm: spi: Update sandbox SPI emulation driver to use ofnode
Update the parameters sandbox_sf_bind_emul to support livetree.

Change-Id: Iec83b813c8cddd750f7061d697304fa05556c5fb
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 008dcddf9937bd2576f98b48eb5bf0f60ad36014)
2019-07-05 19:33:39 +08:00
Jason Zhu cb0376d1ac rockchip: test: emmc: add read/write count for emmc test
Usually, we test the eMMC speed by reading and writing several times
and then taking the average. So add parameter count.

Change-Id: I0a01804b4b35b4a6d9dc8c96ac2bce6a4607301b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-06 15:07:39 +08:00
Joseph Chen f26f96c587 test: rockchip: add rockusb and fastboot cmd
Change-Id: I23072323c2f2ee655a57af0150c2cb90135d3227
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-04 18:07:56 +08:00
Joseph Chen 1e7c429d5d test: rockchip: add command description
=> rktest
Command: rktest [module] [args...]
  - module: timer|key|emmc|rknand|regulator|eth|ir|brom|vendor
  - args: depends on module, try 'rktest [module]' for test or more help

  - Enabled modules:
     -      timer: test timer and interrupt
     -       brom: enter bootrom download mode
     -        key: test board keys
     -       emmc: test emmc read/write speed
     -     rknand: test rknand read/write speed
     -  regulator: test regulator volatge set and show regulator status
     -     vendor: test vendor storage partition read/write

Change-Id: I1f58dd65f7ffb229970cb86cb2f568cbca933336
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-04 17:35:21 +08:00
Joseph Chen 0c653b7e3f test: rockchip: emmc/rknand: remove unused head file
Change-Id: I7d38b27d0e61df979facb1c17907ef18e882b1ad
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-30 16:11:25 +08:00
Joseph Chen dbe1e39c43 test: rockchip: timer: compile depends on CONFIG_IRQ
Change-Id: Ibe626355a882af3e879a604820b7c685c8bd533d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-30 16:11:03 +08:00
Joseph Chen b40c07fc2e test: rockchip: compile depends on dm config
Change-Id: I8e3a7a8dedaa4615426b3d059746d2c080b481c0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-23 10:12:05 +08:00
Joseph Chen d240ec0518 test: rockchip: key: use key_read()
key_read() is a new dm key interface.

Change-Id: Idd950353749482a606085728bac2cac44e1bf58d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 12:20:47 +08:00
Joseph Chen 0b4606ef44 test: rockchip: improve regulator test
1. dump all regulator fdt configure and current status;
2. only adjudst voltage for bucks;

Change-Id: Ib1b1730e0eb8157a9c979e3552932b2c80f40458
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-18 15:20:35 +08:00
Joseph Chen 336e1992eb test: rockchip: improve help guide
Change-Id: I321f9b5357a1ef0ad0617124a84bb4890b45be7e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:40:01 +08:00
Joseph Chen 44e080753f test: rockchip: add vendor storage test
Change-Id: I3bfb884c32e44371fb01351af4b20587f7a1fa1f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:40:01 +08:00
Kever Yang a14c50f0df rockchip: test: eth: fix build error
add header file for cli;
use simplg_strtoul() instead of strtoul();

Change-Id: I274710be24132fd9188be4b2283bea747bcfe667
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-06-01 17:39:46 +08:00
Joseph Chen dc8812a0ee test: rockchip: timer: move out timer irq definition
Change-Id: Ia6322291a6ddb05f7971a0a51e161c046f9e91d2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-19 09:25:49 +08:00
Joseph Chen 6ee123990a test: rockchip: timer: disable timer before configure
Change-Id: I0c1e8749069554f7aa7a63c416cd4691ad0e3761
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-15 15:53:11 +08:00
Joseph Chen b0635068cf test: rockchip: key: add more key event test
add KEY_HOME, KEY_MENU, KEY_ESC.

Change-Id: Ifbf43169973e0a2bbdb062713482ced1ceae7be3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-15 15:53:11 +08:00
Kever Yang d5bbff804f rockchip: test-timer: support ARM64 px30
Add px30 timer 1 base;
Add support for read arm64 arch counter.

Change-Id: I8ea8b6835647d063d1c9a0fa579df0522b0f2c11
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-25 16:40:42 +08:00
Kever Yang eb80c6bc09 rockchip: test: fix size warning in arm64
Fix warning in emmc and nand test case.

Change-Id: Id879e22b2f735d4d72be9a98dd7d9b074b8185ae
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-25 15:11:39 +08:00
Simon Glass 440e24d771 UPSTREAM: dm: core: Add a function to look up a uclass by name
Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the category.

Add a function to handle this, as well as a test.

Change-Id: Id221809d6f9f818b52a5bf88f4e12d409a070f05
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6e43d1b19982b1756b7c607569d1778e556d6577)
2018-02-11 19:58:01 +08:00
Joseph Chen 105f3d76b6 rockchip: test-key: refactor code
use platform_key_read() interface.

Change-Id: I7d8add0a57e818eb73dc098c6f86b5967ad8b554
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Stephen Warren 8820f8d05b UPSTREAM: test/py: Setup variables based on HUSH selection
After adding our small zynq uboot which has hush parser off same
variable tests start to failed. Use quotes only when hush is enabled.

Change-Id: I9aee385346129dee480aa04aa68f420aa172aaa7
Reported-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3e229a83bd4190f99731992d3a56983f29313899)
2018-01-17 15:27:28 +08:00
Felix Brack 29b6917330 UPSTREAM: power: extend prefix match to regulator-name property
This patch extends pmic_bind_children prefix matching. In addition to
the node name the property regulator-name is used while trying to match
prefixes. This allows assigning different drivers to regulator nodes
named regulator@1 and regulator@10 for example.
I have discarded the idea of using other properties then regulator-name
as I do not see any benefit in using property compatible or even
regulator-compatible. Of course I am open to change this if there are
good reasons to do so.

Change-Id: Ifedf2c0a51cb725ddb290ee9dfd54a3fea45df70
Signed-off-by: Felix Brack <fb@ltec.ch>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bf802f5d544f85c03b4097ab23d078be43c61855)
2018-01-17 15:27:28 +08:00
Simon Glass c41d05c301 UPSTREAM: log: test: Add a pytest for logging
Add a test which tries out various filters and options to make sure that
logging works as expected.

Change-Id: Ibbaf607e128356e78769b9db9d6bda235c74ead2
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 20faa27c2bc32b1442970cfe98a3006cf8eac063)
2018-01-17 15:27:28 +08:00
Simon Glass 73991b074b log: Add a test command
Add a command which exercises the logging system.

Change-Id: I4eb139b69937c752d7f6fc42dde3f757260b832b
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ef11ed8239bf02b347e7fb9fc6d980aec0c7810a)
2018-01-17 15:27:28 +08:00
Stephen Warren 1151fbe648 UPSTREAM: test/py: add timestamps to log
It can be useful to record how long tests take; this can help debug slow
running test systems or track changes in performance over time. Enhance
the test system to record timestamps while running test:
- Whenever a new log file section is started.
- After U-Boot is started and communication has been established.
- After each host or U-Boot command is executed.

Change-Id: I1db02bfc1d69c8d6a4c390a778ae433bbd858a9d
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9679d339ad2d4c495d734bad3a0fb7be6c4215eb)
2018-01-17 15:27:28 +08:00
Heinrich Schuchardt 70478c701f UPSTREAM: test/py: u_boot_console_base.py: fix typo
run_command does not have a parameter wait_for_each.

Change-Id: I5b6bb3ed1b732c3ebc307f0618282caea9190b83
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cd3e8a72a6fb1fe758c5f73b394527609afe26cc)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 6d7abe7419 UPSTREAM: test: overlay: Add unit test for stacked overlay
Verify that stacked overlays work.

Change-Id: Id5c578db630bb34e952ca5176bb5ca9815bb0c0f
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ea28e488f743520f7f83b341f28818c32dae1ee3)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou ea99241c37 UPSTREAM: ut: fix fdt_getprop_u32() change
fdt_getprop_u32 is not exported and it's different than what the
unit test uses. Rename u32 prop access methods to something that's
unit test specific.

Change-Id: I0256118c7ae7b6709c4ef0791c53093e3117f23e
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 706708d3b2e7ade443836e7a14802a5a63b59713)
2018-01-16 18:16:48 +08:00
Alison Chaiken 135b53be98 UPSTREAM: add pytests for 'gpt rename' and 'gpt swap'
Add unit tests for the 'gpt rename' and 'gpt swap' commands that
rely on the block device created by test/py/make_test_disk.py.
Add CONFIG_CMD_GPT_RENAME to the sandbox_defconfig.  Remove the
testdisk.raw test device at the end of the tests.

Change-Id: I1c5b963a1f84168d4979ad1591f68a5f2a259935
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c5772188ede914b0e67c2a58ae179039a582afe0)
2018-01-16 18:14:09 +08:00
Alison Chaiken e2c5d1e4e7 UPSTREAM: add pytests for 'gpt guid' command in sandbox
Run unit tests for the 'gpt guid' command, making use of the block
device created by test/py/make_test_disk.py.  Remove this device at
the end of the tests.

Change-Id: I315989b993388fdce6f0b263376463a3532d154b
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a2f422555fc80144aea418c0d8e95341acfe6868)
2018-01-16 18:14:09 +08:00
Alison Chaiken 4d11a85763 UPSTREAM: GPT: create block device for sandbox testing
Provide a Python function that creates a small block device for the
purpose of testing the cmd/gpt.c or cmd/part.c functions in the u-boot
sandbox.

Change-Id: I620c2f97c7b6533d8cb607e365e719246cdb7acd
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bf6d76b84ae13b463c0dca556118047e2d046f33)
2018-01-16 18:14:09 +08:00
Patrice Chotard b048a4dbd0 UPSTREAM: dm: test: replace dm_scan_dt() by of dm_extended_scan_fdt() in dm_do_test
This allows to scan the DT including all "clocks" node's sub-nodes
in which fixed-clock are defined.
All fixed-clock should be defined inside a clocks node which collect all
external oscillators. Until now, all clocks sub-nodes can't be binded except
if the "simple-bus" compatible string is added which is a hack.

Update test.dts by moving clk_fixed node inside clocks.

Change-Id: I9c346d812b0ee270f9b6fc6b6f60af7c28ebb46e
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ee87a097b0f66158ce2985940a5f28ba15a3552d)
2018-01-16 18:13:59 +08:00
Andy Yan 5e7e40617c test: rockchip: add bootrom download mode test
Enter bootrom download mode by command: rktest brom_dnl

Change-Id: I6120a885e5514a57c81fd469ce27a2472009c4fd
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2017-11-20 11:53:22 +08:00
David Wu e630a69b2d rockchip: test: Add ethernet test cases
1. Add phy loopback test
2. Add delayline array scaned
3. Add delayline setting
4. Add dhcp boot from network

Change-Id: I00abc1c7acb4659b78e29bffc12f0964e5d02937
Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-11-13 09:48:59 +08:00
Shawn Lin de2f83b25a rockchip: test: Make start LBA mandatory for emmc test
Support reading start LBA from test command and so that
the developer could understand which area is cleared by
the emmc write test, and he/she recovery the image respectively
from the flashing tool by looking into the parameter file.

Change-Id: Ie050c44bb7ef5c4f0edd5f80370da12420500f08
Suggested-by:  Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-11-09 12:41:57 +08:00
Joseph Chen 7ea94c7847 rockchip: test: key: use ctrl+c to exit test
This is more flexible for users to determine exit or not

Change-Id: Idcd9ad605b8615062fafae485cd2f297ed021fee
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-11-07 16:13:17 +08:00
Joseph Chen 3557321365 rockchip: test: adjust position of guide info
Change-Id: Ibd674a7fea9c8b109e5766d98ef80c15fb612633
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-11-07 16:13:14 +08:00
Zhangbin Tong 08af5e362f rockchip: test: support ir test
Change-Id: I066eeca4fb7e2971ceee8419cbc2b8d00821397f
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-11-03 11:57:10 +08:00
Joseph Chen 9dd6ea8e8e test: fix test-rknand.c compile error
Change-Id: Ib3ad1f217c004f56790691128f739a95feaf2349
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-27 17:30:04 +08:00