[ovs-git] [openvswitch/ovs] 7ee9c6: tests: Fix cluster torture test.

GitHub noreply at github.com
Fri Aug 3 23:37:10 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 7ee9c6e03416613f8461b37d7fdc52205d3c742b
      https://github.com/openvswitch/ovs/commit/7ee9c6e03416613f8461b37d7fdc52205d3c742b
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M tests/ovsdb-cluster.at

  Log Message:
  -----------
  tests: Fix cluster torture test.

A previous commit to improve timing also caused the cluster torture test to
be skipped (unless it failed early).  This is related to the shell "while"
loop's use of a variable $phase to indicate how far it got in the test
procedure.  A very fast machine, or one on which the races went just the
right way, might finish the test before all the torture properly starts, so
the code is designed to just skip the test if that happens.  However, a
commit to improve the accuracy ended up skipping it all the time.

Prior to the timing commit, the loop looked something like this:

    phase=0
    while :; do
  ...things that eventually increment $phase to 2...
    done
    AT_SKIP_IF([test $phase != 2])

This works fine.

The timing commit changed the "while :" to "(...something...) | while
read".  This looks innocuous but it actually causes everything inside the
"while" loop to run in a subshell.  Thus, the increments to $phase are not
visible after the loop ends, and the test always gets skipped.

This commit fixes the problem by storing the phase in a file instead of a
shell variable.

Fixes: 0f03ae3754ec ("ovsdb: Improve timing in cluster torture test.")
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: c7b5c534842884445a5cc1452fee45b3c9fd655e
      https://github.com/openvswitch/ovs/commit/c7b5c534842884445a5cc1452fee45b3c9fd655e
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M tests/ovsdb-cluster.at

  Log Message:
  -----------
  tests: Fix use of variable in cluster torture test.

remove_server() is supposed to deal with its argument $i, not $victim.  In
this case they happen to have the same value so the difference is moot,
but it's still best to be clear.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: f39f02102f669b85a37104e7bc60cb764cc6b2f3
      https://github.com/openvswitch/ovs/commit/f39f02102f669b85a37104e7bc60cb764cc6b2f3
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M tests/ovsdb-cluster.at

  Log Message:
  -----------
  tests: Suppress "long poll interval" messages for ovsdb-cluster tests.

The cluster torture tests can provoke these messages, especially if run in
parallel or with valgrind, and they shouldn't cause a failure.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: 6233b87dbbc7a69f1226cab2d3f10208d16e4dd1
      https://github.com/openvswitch/ovs/commit/6233b87dbbc7a69f1226cab2d3f10208d16e4dd1
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M ovsdb/ovsdb-tool.c

  Log Message:
  -----------
  ovsdb-tool: Fix logic for displaying server names in "check-cluster".

Without this patch, server names are displayed as UUIDs even when we know
the file name; file names are easier for the user to read.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: 6bf2e3f644dfe22a20584a15cc6df294e5efc4c5
      https://github.com/openvswitch/ovs/commit/6bf2e3f644dfe22a20584a15cc6df294e5efc4c5
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M ovsdb/ovsdb-tool.c

  Log Message:
  -----------
  ovsdb-tool: Read server headers first, before full logs, in "check-cluster".

Having the headers available before reading the complete logs means that
server IDs can be associated with the server file names earlier, which can
improve error messages in some cases.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: 7073a83fc731fc997dd51bfdd8cd99dd29a663ab
      https://github.com/openvswitch/ovs/commit/7073a83fc731fc997dd51bfdd8cd99dd29a663ab
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M ovsdb/ovsdb-tool.c

  Log Message:
  -----------
  ovsdb-tool: Check for duplicate server IDs in "check-cluster".

The user shouldn't provide a given server's log more than once but this
check makes sure.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: c2d71875f2a32665d9eaca5e964e76cae2795691
      https://github.com/openvswitch/ovs/commit/c2d71875f2a32665d9eaca5e964e76cae2795691
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M ovsdb/ovsdb-tool.c

  Log Message:
  -----------
  ovsdb-tool: Only check leader completeness when we can, in "check-cluster".

Generally when we know the leader for a term, in "check-cluster", it's
because we read that leader's log file.  In that case, we have the leader's
log_end because it told us.  However, taking a snapshot can discard that
data.  In that case, log_end is 0 and we should not try to check for leader
completeness on that basis.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


Compare: https://github.com/openvswitch/ovs/compare/5da3e1fe02d3...c2d71875f2a3
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list