From 40a159f9e11908f39e3bb03af9454ffe9967f1e7 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 18 Oct 2022 08:46:05 +0200 Subject: [PATCH 1/2] suite/link-aggregation: Whitespace cleanup --- suite/70-link-aggregation.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/suite/70-link-aggregation.sh b/suite/70-link-aggregation.sh index 10e8f17..1753c6e 100644 --- a/suite/70-link-aggregation.sh +++ b/suite/70-link-aggregation.sh @@ -8,7 +8,7 @@ lag_setup() ip link set $bond type bond miimon 100 mode balance-xor lag_link_setup $@ - + ip link set $bond up } @@ -19,25 +19,25 @@ lag_link_setup() local links=$@ for link in $links; do - ip link set $link down - ip link set $link master $bond - ip link set $link up + ip link set $link down + ip link set $link master $bond + ip link set $link up - waitlink $link + waitlink $link done } lag_basic_connectivity() { require2loops - + step "Setup basic link aggregation" lag_setup bond0 $h1 lag_setup bond1 $b1 capture bond1 - + step "Inject traffic towards bond1 from bond0" eth -I bond1 -i bond0 | { cat; echo from bond0; } | inject bond0 @@ -62,9 +62,9 @@ lag_add_link() lag_link_setup bond0 $h3 lag_link_setup bond1 $b3 - + capture bond1 - + step "Inject traffic from bond0 towards bond1 " eth -I bond1 -i bond0 | { cat; echo from bond0; } | inject bond0 From c22655418b8f6fdd5446f056f81c7d83f9e3a263 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 18 Oct 2022 09:21:35 +0200 Subject: [PATCH 2/2] suite/link-aggregation: Ensure LAGs are up before traffic test This avoids races between the hardware link negotiation and packet injection. --- suite/70-link-aggregation.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/suite/70-link-aggregation.sh b/suite/70-link-aggregation.sh index 1753c6e..bbf67f0 100644 --- a/suite/70-link-aggregation.sh +++ b/suite/70-link-aggregation.sh @@ -36,6 +36,9 @@ lag_basic_connectivity() lag_setup bond0 $h1 lag_setup bond1 $b1 + waitlink bond0 + waitlink bond1 + capture bond1 step "Inject traffic towards bond1 from bond0" @@ -63,6 +66,9 @@ lag_add_link() lag_link_setup bond0 $h3 lag_link_setup bond1 $b3 + waitlink bond0 + waitlink bond1 + capture bond1 step "Inject traffic from bond0 towards bond1 " @@ -92,7 +98,9 @@ lag_remove_link() ip link set bond0 up ip link set bond1 up + waitlink bond0 + waitlink bond1 capture bond1