diff mbox series

[ovs-dev,1/2] tests: Reduce flakiness of daemon ssl files change test

Message ID 20240110124045.778257-1-amusil@redhat.com
State Accepted
Headers show
Series [ovs-dev,1/2] tests: Reduce flakiness of daemon ssl files change test | 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 success github build: passed

Commit Message

Ales Musil Jan. 10, 2024, 12:40 p.m. UTC
The test is changing certificates when the ovn-nbctl is running
as daemon and expects that the mismatch will be detected. In most
cases this is fine because the main loop of the ovn-nbctl will be
woken up by something external. However, when the host is busy it might
not be woken up in time.

Wake the daemon right away by calling show command. At the same time
ensure that there is only 1 mismatch after the whole process.

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

Comments

Mark Michelson Jan. 16, 2024, 9:42 p.m. UTC | #1
Thanks Ales, it looks good to me.

Acked-by: Mark Michelson <mmichels@redhat.com>

On 1/10/24 07:40, Ales Musil wrote:
> The test is changing certificates when the ovn-nbctl is running
> as daemon and expects that the mismatch will be detected. In most
> cases this is fine because the main loop of the ovn-nbctl will be
> woken up by something external. However, when the host is busy it might
> not be woken up in time.
> 
> Wake the daemon right away by calling show command. At the same time
> ensure that there is only 1 mismatch after the whole process.
> 
> Signed-off-by: Ales Musil <amusil@redhat.com>
> ---
>   tests/ovn-nbctl.at | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
> index 2d74e9cc6..7f37d7716 100644
> --- a/tests/ovn-nbctl.at
> +++ b/tests/ovn-nbctl.at
> @@ -2736,11 +2736,17 @@ check ovn-appctl -t ovn-nbctl run init
>   # Overwrite with mismatched key and cert
>   cp $PKIDIR/$key2 $key
>   cp $PKIDIR/$cert3 $cert
> +
> +# Wakeup the ovn-nbctl loop
> +ovn-appctl -t ovn-nbctl run show
>   OVS_WAIT_UNTIL([grep mismatch ovn-nbctl.log])
>   
>   cp $PKIDIR/$key $key
>   cp $PKIDIR/$cert $cert
>   OVS_WAIT_UNTIL([ovn-appctl -t ovn-nbctl run show])
> +AT_CHECK([grep -c mismatch ovn-nbctl.log], [0], [dnl
> +1
> +])
>   
>   AT_CLEANUP
>
Numan Siddique Jan. 25, 2024, 11:34 p.m. UTC | #2
On Tue, Jan 16, 2024 at 4:42 PM Mark Michelson <mmichels@redhat.com> wrote:
>
> Thanks Ales, it looks good to me.
>
> Acked-by: Mark Michelson <mmichels@redhat.com>

Thanks.  Applied to the main.

Numan

>
> On 1/10/24 07:40, Ales Musil wrote:
> > The test is changing certificates when the ovn-nbctl is running
> > as daemon and expects that the mismatch will be detected. In most
> > cases this is fine because the main loop of the ovn-nbctl will be
> > woken up by something external. However, when the host is busy it might
> > not be woken up in time.
> >
> > Wake the daemon right away by calling show command. At the same time
> > ensure that there is only 1 mismatch after the whole process.
> >
> > Signed-off-by: Ales Musil <amusil@redhat.com>
> > ---
> >   tests/ovn-nbctl.at | 6 ++++++
> >   1 file changed, 6 insertions(+)
> >
> > diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
> > index 2d74e9cc6..7f37d7716 100644
> > --- a/tests/ovn-nbctl.at
> > +++ b/tests/ovn-nbctl.at
> > @@ -2736,11 +2736,17 @@ check ovn-appctl -t ovn-nbctl run init
> >   # Overwrite with mismatched key and cert
> >   cp $PKIDIR/$key2 $key
> >   cp $PKIDIR/$cert3 $cert
> > +
> > +# Wakeup the ovn-nbctl loop
> > +ovn-appctl -t ovn-nbctl run show
> >   OVS_WAIT_UNTIL([grep mismatch ovn-nbctl.log])
> >
> >   cp $PKIDIR/$key $key
> >   cp $PKIDIR/$cert $cert
> >   OVS_WAIT_UNTIL([ovn-appctl -t ovn-nbctl run show])
> > +AT_CHECK([grep -c mismatch ovn-nbctl.log], [0], [dnl
> > +1
> > +])
> >
> >   AT_CLEANUP
> >
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
diff mbox series

Patch

diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 2d74e9cc6..7f37d7716 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -2736,11 +2736,17 @@  check ovn-appctl -t ovn-nbctl run init
 # Overwrite with mismatched key and cert
 cp $PKIDIR/$key2 $key
 cp $PKIDIR/$cert3 $cert
+
+# Wakeup the ovn-nbctl loop
+ovn-appctl -t ovn-nbctl run show
 OVS_WAIT_UNTIL([grep mismatch ovn-nbctl.log])
 
 cp $PKIDIR/$key $key
 cp $PKIDIR/$cert $cert
 OVS_WAIT_UNTIL([ovn-appctl -t ovn-nbctl run show])
+AT_CHECK([grep -c mismatch ovn-nbctl.log], [0], [dnl
+1
+])
 
 AT_CLEANUP