From 82a3c9ef20d43d97416589854b4bbcb4c2450c24 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 25 Feb 2021 16:51:11 +0100 Subject: net: use the same alias stem for ethernet as linux Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree: $ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633 In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit fc054d563bfb ("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree. Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees. Cc: David Wu Signed-off-by: Michael Walle Reviewed-by: Fabio Estevam Reviewed-by: Simon Glass --- test/dm/ofnode.c | 2 +- test/dm/test-fdt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index e0b525eeb18..de895773b55 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -213,7 +213,7 @@ static int dm_test_ofnode_read_aliases(struct unit_test_state *uts) ofnode node; int size; - node = ofnode_get_aliases_node("eth3"); + node = ofnode_get_aliases_node("ethernet3"); ut_assert(ofnode_valid(node)); ut_asserteq_str("sbe5", ofnode_get_name(node)); diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index d273e218530..8866d4d959d 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -183,7 +183,7 @@ static int dm_test_alias_highest_id(struct unit_test_state *uts) { int ret; - ret = dev_read_alias_highest_id("eth"); + ret = dev_read_alias_highest_id("ethernet"); ut_asserteq(5, ret); ret = dev_read_alias_highest_id("gpio"); -- cgit v1.2.3 From b2710faf82998d7be9e4eef554063a5e27e88ec9 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 10 Jun 2021 18:08:42 +0300 Subject: test: Include /sbin to the PATH when creating file system On some distributions the mkfs is under /sbin and /sbin is not set for mere users. Include /sbin to the PATH when creating file system, so that users won't get a scary traceback from Python. Signed-off-by: Andy Shevchenko --- test/py/tests/test_fs/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py index 410a675b971..7325486cdb1 100644 --- a/test/py/tests/test_fs/conftest.py +++ b/test/py/tests/test_fs/conftest.py @@ -159,6 +159,10 @@ def mk_fs(config, fs_type, size, id): count = (size + 1048576 - 1) / 1048576 + # Some distributions do not add /sbin to the default PATH, where mkfs lives + if '/sbin' not in os.environ["PATH"].split(os.pathsep): + os.environ["PATH"] += os.pathsep + '/sbin' + try: check_call('rm -f %s' % fs_img, shell=True) check_call('dd if=/dev/zero of=%s bs=1M count=%d' -- cgit v1.2.3