selftests: forwarding: Move start_/stop_traffic from mlxsw to lib.sh
authorPetr Machata <petrm@mellanox.com>
Wed, 18 Dec 2019 14:55:21 +0000 (14:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Dec 2019 21:32:30 +0000 (13:32 -0800)
These two functions are used for starting several streams of traffic, and
then stopping them later. They will be handy for the test coverage of ETS
Qdisc. Move them from mlxsw-specific qos_lib.sh to the generic lib.sh.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh
tools/testing/selftests/net/forwarding/lib.sh

index e80be65799adf6ff3b46e0883f14bfbc3f11d7b4..75a3fb3b5663539404d6de7b93e0d7db04c9caab 100644 (file)
@@ -24,24 +24,6 @@ rate()
        echo $((8 * (t1 - t0) / interval))
 }
 
-start_traffic()
-{
-       local h_in=$1; shift    # Where the traffic egresses the host
-       local sip=$1; shift
-       local dip=$1; shift
-       local dmac=$1; shift
-
-       $MZ $h_in -p 8000 -A $sip -B $dip -c 0 \
-               -a own -b $dmac -t udp -q &
-       sleep 1
-}
-
-stop_traffic()
-{
-       # Suppress noise from killing mausezahn.
-       { kill %% && wait %%; } 2>/dev/null
-}
-
 check_rate()
 {
        local rate=$1; shift
index 1f64e7348f6999fde2209f6ea36bb98b46add0af..a0b09bb6995ed97e92e90bd597a93917b5c0d757 100644 (file)
@@ -1065,3 +1065,21 @@ flood_test()
        flood_unicast_test $br_port $host1_if $host2_if
        flood_multicast_test $br_port $host1_if $host2_if
 }
+
+start_traffic()
+{
+       local h_in=$1; shift    # Where the traffic egresses the host
+       local sip=$1; shift
+       local dip=$1; shift
+       local dmac=$1; shift
+
+       $MZ $h_in -p 8000 -A $sip -B $dip -c 0 \
+               -a own -b $dmac -t udp -q &
+       sleep 1
+}
+
+stop_traffic()
+{
+       # Suppress noise from killing mausezahn.
+       { kill %% && wait %%; } 2>/dev/null
+}