On 12/29/23 14:19, Yujie Liu wrote:
The patch set [1] added a general lib.sh in net selftests, and converted several test scripts to source the lib.sh.
unicast_extensions.sh (converted in [1]) and pmtu.sh (converted in [2]) have a /bin/sh shebang which may point to various shells in different distributions, but "source" is only available in some of them. For example, "source" is a built-it function in bash, but it cannot be used in dash.
Refer to other scripts that were converted together, simply change the shebang to bash to fix the following issues when the default /bin/sh points to other shells.
(snip)
Link: https://lore.kernel.org/all/20231202020110.362433-1-liuhangbin@gmail.com/ [1] Link: https://lore.kernel.org/all/20231219094856.1740079-1-liuhangbin@gmail.com/ [2] Reported-by: kernel test robot oliver.sang@intel.com Signed-off-by: Yujie Liu yujie.liu@intel.com
I would recommend use of shellcheck in the future, it will catch this particular bug, with following warning: SC3046: In POSIX sh, 'source' in place of '.' is undefined.
Being specific, and requiring bash looks fine for me.
Reviewed-by: Przemek Kitszel przemyslaw.kitszel@intel.com