diff mbox series

[ovs-dev,3/4] tests: Make sure the port group is not hardcoded

Message ID 20230814092155.41811-3-amusil@redhat.com
State Superseded
Headers show
Series [ovs-dev,1/4] tests: Check proper DP and port key | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Ales Musil Aug. 14, 2023, 9:21 a.m. UTC
The port group name consists of DP key and NB PG name.
Use first PG that is avaiable to avoid flakes when
neither of the logical switches has DP key 2.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 tests/ovn.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Michelson Aug. 14, 2023, 8:02 p.m. UTC | #1
Acked-by: Mark Michelson <mmichels@redhat.com>

On 8/14/23 05:21, Ales Musil wrote:
> The port group name consists of DP key and NB PG name.
> Use first PG that is avaiable to avoid flakes when
> neither of the logical switches has DP key 2.
> 
> Signed-off-by: Ales Musil <amusil@redhat.com>
> ---
>   tests/ovn.at | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 9bb4b7287..56ac17261 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -32487,9 +32487,9 @@ AT_CHECK([test $(ovs-ofctl dump-flows br-int table=46 | grep conjunction | wc -l
>   
>   for i in $(seq 1 10); do
>       # Delete and recreate the SB PG with same name and content.
> -    sb_pg_name=2_pg1 # dp key + NB pg name
> +    sb_pg_name=$(fetch_column port_group name | cut -d ' ' -f1)
>       sb_pg_uuid=$(fetch_column port_group _uuid name=$sb_pg_name)
> -    ports_=$(fetch_column port_group ports name=2_pg1)
> +    ports_=$(fetch_column port_group ports name=$sb_pg_name)
>       ports=${ports_/ /,}
>       AT_CHECK([ovn-sbctl destroy port_group $sb_pg_uuid -- create port_group name=$sb_pg_name ports=$ports], [0], [ignore])
>
diff mbox series

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index 9bb4b7287..56ac17261 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -32487,9 +32487,9 @@  AT_CHECK([test $(ovs-ofctl dump-flows br-int table=46 | grep conjunction | wc -l
 
 for i in $(seq 1 10); do
     # Delete and recreate the SB PG with same name and content.
-    sb_pg_name=2_pg1 # dp key + NB pg name
+    sb_pg_name=$(fetch_column port_group name | cut -d ' ' -f1)
     sb_pg_uuid=$(fetch_column port_group _uuid name=$sb_pg_name)
-    ports_=$(fetch_column port_group ports name=2_pg1)
+    ports_=$(fetch_column port_group ports name=$sb_pg_name)
     ports=${ports_/ /,}
     AT_CHECK([ovn-sbctl destroy port_group $sb_pg_uuid -- create port_group name=$sb_pg_name ports=$ports], [0], [ignore])