[ovs-dev] [ofproto tests 00/29] add unit tests for ofproto

Ben Pfaff blp at nicira.com
Tue Nov 16 19:20:50 UTC 2010


The main point of this series is to add unit tests for ofproto.
It does a lot more than that, though, because I discovered a
number of bugs (see the first few patches in the series) and a
lot needed cleanup along the way.

The actual tests that it adds are not very impressive, but it
should be pretty easy to start adding more of them now.

Ben Pfaff (29):
  ovs-ofctl: Fix return value of str_to_port_no().
  netdev-vport: Fix poll_add() implementation.
  ofp-util: Use a counter for transaction IDs instead of a random
    number.
  ofp-util: Consistently treat OpenFlow xids as network byte order.
  netdev-vport: Remove OVS_UNUSED from argument that is actually used.
  lib: Remove redundant dhparams.h from EXTRA_DIST.
  dpif: Use caller-provided dpif_class in dp_register_provider().
  dpif: Make dpif_class 'open' function take class instead of type
    name.
  dpif-netdev: Simplify code by using shash for names and dropping
    indexes.
  dpif-netdev: Do not log error for EOPNOTSUPP return from
    netdev_recv().
  Add new "dummy" netdev and dpif implementations for use in unit
    tests.
  Make installation directories overridable at runtime.
  ovs-openflowd: Add --unixctl command line option.
  ovs-openflowd: Add --enable-dummy option.
  ovs-openflowd: Improve usage message.
  ovs-openflowd: Add ability to run without connecting to controller.
  ovs-openflowd: Add "exit" unixctl command.
  ofproto: Fix typo in comment.
  Convert stream and vconn interfaces to use ovs_be16, ovs_be32.
  unaligned: Add unaligned accessors for ovs_be<N> data.
  ovs-ofctl: Simplify code by using strcasecmp() instead of
    strncasecmp().
  ovs-ofctl: Remove stray printf.
  ovs-ofctl: Factor out common code in str_to_port_no(), do_mod_port().
  ovs-ofctl: Remove now-useless "tun-cookie" command.
  vconn: New function vconn_transact_noreply().
  ovs-ofctl: Check that commands actually succeed.
  openflow: Change ofp_phy_port's 'name' member from uint8_t[] to
    char[].
  openflow: Remove vestigial support for including from kernel.
  tests: Add tests for ofproto code.

 include/openflow/openflow.h  |    6 +-
 lib/automake.mk              |   20 ++-
 lib/daemon.c                 |    6 +-
 lib/dirs.c.in                |   66 ++++++++
 lib/dirs.h                   |   10 +-
 lib/dpif-linux.c             |    4 +-
 lib/dpif-netdev.c            |  153 ++++++++-----------
 lib/dpif-provider.h          |   13 +-
 lib/dpif.c                   |   21 ++--
 lib/{dirs.h => dummy.c}      |   22 ++-
 lib/{dirs.h => dummy.h}      |   18 ++-
 lib/flow.c                   |    4 +-
 lib/learning-switch.c        |    2 +-
 lib/netdev-dummy.c           |  335 ++++++++++++++++++++++++++++++++++++++++++
 lib/netdev-vport.c           |    6 +-
 lib/nx-match.c               |   40 +++---
 lib/ofp-print.c              |    4 +-
 lib/ofp-util.c               |   18 +-
 lib/ofp-util.h               |    7 +-
 lib/stream-provider.h        |   18 +-
 lib/stream.c                 |   16 +-
 lib/stream.h                 |    9 +-
 lib/unaligned.h              |   68 ++++++---
 lib/unixctl.c                |   27 +++-
 lib/unixctl.man              |    2 +
 lib/vconn-provider.h         |   18 +-
 lib/vconn.c                  |  102 +++++++++++--
 lib/vconn.h                  |    9 +-
 lib/vlog-modules.def         |    1 +
 lib/vlog.c                   |    4 +-
 ofproto/ofproto.c            |   16 +-
 python/ovs/automake.mk       |   10 +-
 python/ovs/dirs.py           |    9 +-
 tests/automake.mk            |    1 +
 tests/ofproto.at             |   57 +++++++
 tests/test-classifier.c      |    6 +-
 tests/testsuite.at           |    1 +
 utilities/ovs-appctl.c       |    4 +-
 utilities/ovs-discover.c     |    2 +-
 utilities/ovs-ofctl.c        |  188 ++++++++++--------------
 utilities/ovs-openflowd.8.in |   16 ++
 utilities/ovs-openflowd.c    |   50 ++++++-
 utilities/ovs-vsctl.c        |    2 +-
 vswitchd/bridge.c            |    4 +-
 vswitchd/ovs-brcompatd.c     |    2 +-
 vswitchd/ovs-vswitchd.c      |    9 +-
 vswitchd/system-stats.c      |    6 +-
 47 files changed, 1007 insertions(+), 405 deletions(-)
 create mode 100644 lib/dirs.c.in
 copy lib/{dirs.h => dummy.c} (54%)
 copy lib/{dirs.h => dummy.h} (60%)
 create mode 100644 lib/netdev-dummy.c
 create mode 100644 tests/ofproto.at





More information about the dev mailing list