selftests: net: tsn_lib: allow running ptp4l on multiple interfaces
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 23 Sep 2022 21:00:13 +0000 (00:00 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 26 Sep 2022 20:22:00 +0000 (13:22 -0700)
commit7ff9396ee82c84ad18b897f70e4486c9ad1693f8
treefb3be8fecbc9bedd3097e6f3e7c277794c5ff2c1
parent7d45b5fd27b4ca53c19dba79d9d4936d6cb0f0ca
selftests: net: tsn_lib: allow running ptp4l on multiple interfaces

Switch ports will want to act as Boundary Clocks, which are configured
using ptp4l by specifying the "-i" argument multiple times.

Since we track a log file and a pid file for each ptp4l instance, and we
want to be compatible with the existing single-port callers of
ptp4l_start and ptp4l_stop, pass the interface list as a single string
of space-separated values. Based on this, we create a label for each
ptp4l instance, where the spaces are replaced with underscores
(ptp4l_start "eth0 eth1" generates "ptp4l_pid_eth0_eth1").

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/tsn_lib.sh