u-boot-brain/test
Claudiu Manoil ff98da0667 sandbox: Add a DSA sandbox driver and unit test
The DSA sandbox driver is used for unit testing the DSA class code.
It implements a simple 2 port switch plus 1 CPU port, and uses a
very simple tag to identify the ports.

The DSA sandbox device is connected via CPU port to a regular Ethernet
sandbox device, called 'dsa-test-eth, managed by the existing eth
sandbox driver.  The 'dsa-test-eth' is not intended for testing the
eth class code however, but it is used to emulate traffic through the
'lan0' and 'lan1' front pannel switch ports.  To achieve this the dsa
sandbox driver registers a tx handler for the 'dsa-test-eth' device.
The switch ports, labeled as 'lan0' and 'lan1', are also registered
as eth devices by the dsa class code this time.  So pinging through
these switch ports is as easy as:

=> setenv ethact lan0
=> ping 1.2.3.5

Unit tests for the dsa class code were also added.  The 'dsa_probe'
test exercises most API functions from dsa.h.  The 'dsa' unit test
simply exercises ARP/ICMP traffic through the two switch ports,
including tag injection and extraction, with the help of the dsa
sandbox driver.

I took care to minimize the impact on the existing eth unit tests,
though some adjustments needed to be made with the addition of
extra eth interfaces used by the dsa unit tests. The additional eth
interfaces also require MAC addresses, these have been added to the
sandbox default environment.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Message-Id: <20210216224804.3355044-5-olteanv@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-04-15 14:22:17 +05:30
..
cmd hush: Fix assignments being misinterpreted as commands 2021-04-12 17:17:11 -04:00
dm sandbox: Add a DSA sandbox driver and unit test 2021-04-15 14:22:17 +05:30
env test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
fs Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
image spl: test: Add a test for spl_load_simple_fit() 2021-03-12 09:57:31 -05:00
lib test: Add test for strlcat 2021-04-12 17:44:55 -04:00
log log: Handle line continuation 2021-03-12 17:41:35 -05:00
optee test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
overlay test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
py test: qemu: add qfw sandbox driver, dm tests, qemu tests 2021-04-12 17:45:39 -04:00
stdint Remove <inttypes.h> includes and PRI* usages in printf() entirely 2018-09-10 20:48:17 -04:00
trace SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bloblist.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
bootm.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
cmd_ut.c Prepare v2021.04-rc4 2021-03-15 12:15:38 -04:00
command_ut.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
common.sh Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
compression.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
Kconfig test: linking test/compression.c fails 2020-11-05 09:11:31 -07:00
Makefile spl: test: Add a test for spl_load_simple_fit() 2021-03-12 09:57:31 -05:00
nokia_rx51_test.sh Nokia RX-51: Add test for U-Boot serial console 2021-01-12 10:59:04 +05:30
print_ut.c dm: test: Always include command.h for print_ut 2021-03-28 17:30:35 -04:00
run test: Run sandbox_spl tests on sandbox_noinst 2021-03-26 17:03:09 +13:00
str_ut.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
test-main.c test: Allow tests to run on any board 2021-04-06 16:33:19 +12:00
time_ut.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
unicode_ut.c Prepare v2021.04-rc4 2021-03-15 12:15:38 -04:00
ut.c test: Move delay skipping to test_pre_run() 2021-03-12 09:57:30 -05:00