summaryrefslogtreecommitdiff
path: root/test/dm/eth.c
Commit message (Collapse)AuthorAgeLines
* dm: test: Add a new test case against dm eth codes for NULL pointer accessBin Meng2015-10-29-0/+64
| | | | | | | | | | | | | U-Boot crashes when doing a 'ping' with the following test scenario: - All ethernet devices are not probed - "ethaddr" for all ethernet devices are not set - "ethact" is set to a valid ethernet device name Add a new test case 'dm_test_eth_act' to hit such scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* dm: test: Add a new test case for dm_test_eth_rotateBin Meng2015-09-09-0/+5
| | | | | | | | | Add one more ethernet device node in the sandbox test device tree, with name 'sbe5'. This is to support a new test case for testing network device rotation. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* test: dm: eth: Handle failed test env cleanupJoe Hershberger2015-05-21-25/+56
| | | | | | | Make sure that the env gets cleaned up after a test fails so that other tests aren't affected. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* test: Generalize the unit test frameworkJoe Hershberger2015-05-21-7/+7
| | | | | | | | | Separate the ability to define tests and assert status of test functions from the dm tests so they can be used more consistently throughout all tests. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* net: Apply default format rules to all ethaddrJoe Hershberger2015-05-21-0/+3
| | | | | | | | Use a regular expression to apply the default formatting flags for all ethaddr env vars. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: eth: Skip timeouts on ping testsJoe Hershberger2015-05-05-0/+2
| | | | | | | | Indicate to the emulated sandbox Ethernet driver when we expect a timeout and tell it to leap forward. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: cosmetic: Fix checkpatch.pl failures in net.cJoe Hershberger2015-04-18-14/+14
| | | | | | | Finish eliminating CamelCase from net.c and other failures Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: cosmetic: Change IPaddr_t to struct in_addrJoe Hershberger2015-04-18-5/+5
| | | | | | | | | This patch is simply clean-up to make the IPv4 type that is used match what Linux uses. It also attempts to move all variables that are IP addresses use good naming instead of CamelCase. No functional change. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: Improve error handlingJoe Hershberger2015-04-18-2/+2
| | | | | | | | | | | | Take a pass at plumbing errors through to the users of the network stack Currently only the start() function errors will be returned from NetLoop(). recv() tends not to have errors, so that is likely not worth adding. send() certainly can return errors, but this patch does not attempt to plumb them yet. halt() is not expected to error. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: net: Add a test of the netretry behaviorJoe Hershberger2015-04-18-0/+32
| | | | | | | | The effect of the "netretry" env var was recently changed. This test checks that behavior. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: eth: Add testing for ethrotate env varJoe Hershberger2015-04-18-0/+42
| | | | | | | Make sure that the ethrotate behavior occurs as expected. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: eth: Add support for ethprime env varJoe Hershberger2015-04-18-0/+20
| | | | | | | | The ethprime env var is used to indicate the starting device if none is specified in ethact. Also support aliases specified in the ethprime var. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: eth: Add support for aliasesJoe Hershberger2015-04-18-0/+24
| | | | | | | | | | Allow network devices to be referred to as "eth0" instead of "eth@12345678" when specified in ethact. Add tests to verify this behavior. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: eth: Add tests for the eth dm implementationJoe Hershberger2015-04-18-0/+38
Add a test for the eth uclass using the sandbox eth driver. Verify basic functionality of the network stack / eth uclass by exercising the ping function. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>