[ovs-git] [openvswitch/ovs] 533fee: tests: Fix cluster torture test.

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


  Branch: refs/heads/branch-2.10
  Home:   https://github.com/openvswitch/ovs
  Commit: 533feeef2b699fd10af67e0b3d913c849cea06ca
      https://github.com/openvswitch/ovs/commit/533feeef2b699fd10af67e0b3d913c849cea06ca
  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: c6d6506779acc3a748213dc04e2059f5a7973e62
      https://github.com/openvswitch/ovs/commit/c6d6506779acc3a748213dc04e2059f5a7973e62
  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: 7986140f46153c63debeb523bc700daa08f2a597
      https://github.com/openvswitch/ovs/commit/7986140f46153c63debeb523bc700daa08f2a597
  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: da5abe35ce96b32352dda14d6b287f54bb7d47e2
      https://github.com/openvswitch/ovs/commit/da5abe35ce96b32352dda14d6b287f54bb7d47e2
  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: 1ed56faf0b9620c16cf79874b90917f10373225f
      https://github.com/openvswitch/ovs/commit/1ed56faf0b9620c16cf79874b90917f10373225f
  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: 7f46f02180615cd5e688a3955761fab6ca025533
      https://github.com/openvswitch/ovs/commit/7f46f02180615cd5e688a3955761fab6ca025533
  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: 07681c175872a81b82abf38f5cd087813614a9c2
      https://github.com/openvswitch/ovs/commit/07681c175872a81b82abf38f5cd087813614a9c2
  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/8c0d478038b6...07681c175872
      **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