[ovs-git] [ovn-org/ovn] 39242c: northd: refactor and split some IPAM functions

Mark Michelson noreply at github.com
Wed Jan 13 15:02:19 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/ovn-org/ovn
  Commit: 39242c106eff35cf8333cae3ceb340eb64ce610c
      https://github.com/ovn-org/ovn/commit/39242c106eff35cf8333cae3ceb340eb64ce610c
  Author: Mark Michelson <mmichels at redhat.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    M northd/automake.mk
    A northd/ipam.c
    A northd/ipam.h
    M northd/ovn-northd.c

  Log Message:
  -----------
  northd: refactor and split some IPAM functions

This refactor focuses on three efforts:
* Break a large function into smaller functions
* Pass more specific data types to functions
* Isolate these functions in their own code unit

Smaller functions have clearer purposes, have fewer chances of unwanted
side effects, and are easier to test. The next commit in this series
will add some unit tests that exercise the new functions created in
this commit.

Note that this is not a full refactor of IPAM. Dynamic address
assignment is complicated and currently tightly coupled with datapath
and port constructs. A refactor of that section of IPAM is difficult
enough that it should have its own patch series separate from this one
that focuses mostly on unit tests.

Signed-off-by: Mark Michelson <mmichels at redhat.com>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 247f76782d853d8f068d2fbdd54dc7770738f002
      https://github.com/ovn-org/ovn/commit/247f76782d853d8f068d2fbdd54dc7770738f002
  Author: Mark Michelson <mmichels at redhat.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    A northd/test-ipam.c
    M tests/automake.mk
    A tests/ovn-ipam.at
    M tests/testsuite.at

  Log Message:
  -----------
  Add ipam unit tests

This adds unit tests for IPAM IPv6 initialization, IPv4 initialization,
and IPv4 address retrieval.

Signed-off-by: Mark Michelson <mmichels at redhat.com>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: a3929e7e5c5959a6e152cbb15b82901b0f46d97d
      https://github.com/ovn-org/ovn/commit/a3929e7e5c5959a6e152cbb15b82901b0f46d97d
  Author: Mark Michelson <mmichels at redhat.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    M tests/ovn-ipam.at
    M tests/ovstest.c

  Log Message:
  -----------
  Disable logging to the console from ovstest.

By default, OVN and OVS errors and warnings are written to
stderr. GNU Autotest automatically fails a test if unexpected
data is written to stderr. This causes two problems:
1) Unit tests that attempt off-nominal code paths may
   fail because of a warning message in OVN or OVS. To get
   around this, it is common for tests to pass "[ignore]"
   to AT_CHECK's stderr parameter so that OVN/OVS log messages
   do not cause failures. But...
2) Passing "[ignore]" makes it so that unit tests cannot
   then print their own messages to stderr to help debug
   test failures.

By disabling OVS/OVN log messages from going to the console, we allow
for tests to write their own messages to stderr.

Signed-off-by: Mark Michelson <mmichels at redhat.com>
Acked-by: Dumitru Ceara <dceara at redhat.com>


Compare: https://github.com/ovn-org/ovn/compare/4d3cb42b076b...a3929e7e5c59


More information about the git mailing list