Skip to content
Snippets Groups Projects
Commit 71d7971f authored by Bin Meng's avatar Bin Meng Committed by Simon Glass
Browse files

dm: test: Add a new test case for dm_test_eth_rotate


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: default avatarBin Meng <bmeng.cn@gmail.com>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent d8f79afa
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
aliases { aliases {
console = &uart0; console = &uart0;
eth0 = "/eth@10002000"; eth0 = "/eth@10002000";
eth3 = &eth_3;
eth5 = &eth_5; eth5 = &eth_5;
i2c0 = "/i2c@0"; i2c0 = "/i2c@0";
pci0 = &pci; pci0 = &pci;
...@@ -121,6 +122,12 @@ ...@@ -121,6 +122,12 @@
fake-host-hwaddr = <0x00 0x00 0x66 0x44 0x22 0x11>; fake-host-hwaddr = <0x00 0x00 0x66 0x44 0x22 0x11>;
}; };
eth_3: sbe5 {
compatible = "sandbox,eth";
reg = <0x10005000 0x1000>;
fake-host-hwaddr = <0x00 0x00 0x66 0x44 0x22 0x33>;
};
eth@10004000 { eth@10004000 {
compatible = "sandbox,eth"; compatible = "sandbox,eth";
reg = <0x10004000 0x1000>; reg = <0x10004000 0x1000>;
......
...@@ -187,7 +187,8 @@ ...@@ -187,7 +187,8 @@
#define SANDBOX_ETH_SETTINGS "ethaddr=00:00:11:22:33:44\0" \ #define SANDBOX_ETH_SETTINGS "ethaddr=00:00:11:22:33:44\0" \
"eth1addr=00:00:11:22:33:45\0" \ "eth1addr=00:00:11:22:33:45\0" \
"eth5addr=00:00:11:22:33:46\0" \ "eth3addr=00:00:11:22:33:46\0" \
"eth5addr=00:00:11:22:33:47\0" \
"ipaddr=1.2.3.4\0" "ipaddr=1.2.3.4\0"
#define MEM_LAYOUT_ENV_SETTINGS \ #define MEM_LAYOUT_ENV_SETTINGS \
......
...@@ -106,6 +106,11 @@ static int _dm_test_eth_rotate2(struct unit_test_state *uts) ...@@ -106,6 +106,11 @@ static int _dm_test_eth_rotate2(struct unit_test_state *uts)
ut_assertok(net_loop(PING)); ut_assertok(net_loop(PING));
ut_asserteq_str("eth@10004000", getenv("ethact")); ut_asserteq_str("eth@10004000", getenv("ethact"));
/* Make sure we can handle device name which is not eth# */
setenv("ethact", "sbe5");
ut_assertok(net_loop(PING));
ut_asserteq_str("sbe5", getenv("ethact"));
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment