[ovs-dev] [PATCH v2 21/21] ovn-trace: New utility.

nickcooper-zhangtonghao nickcooper-zhangtonghao at opencloud.tech
Tue Aug 9 00:08:20 UTC 2016


> On Aug 9, 2016, at 12:15 AM, dev-request at openvswitch.org wrote:
> 
> Date: Mon,  8 Aug 2016 09:14:32 -0700
> From: Ben Pfaff <blp at ovn.org <mailto:blp at ovn.org>>
> To: dev at openvswitch.org <mailto:dev at openvswitch.org>
> Cc: Ben Pfaff <blp at ovn.org <mailto:blp at ovn.org>>
> Subject: [ovs-dev] [PATCH v2 21/21] ovn-trace: New utility.
> Message-ID: <1470672872-19450-22-git-send-email-blp at ovn.org <mailto:1470672872-19450-22-git-send-email-blp at ovn.org>>
> 
> This new utility is intended to fulfill for OVN the purpose that
> "ofproto/trace" has for Open vSwitch.  First, it's meant to be a useful
> tool for troubleshooting and diagnosis and in general for improving one's
> understanding of the emergent properties of a flow table.  Second, it
> simplifies and increases the practical scope of testing, as well as making
> testing more reliable and repeatable and failures easier to interpret.
> 
> This commit adds only a single test that uses the new utility, based on the
> oldest OVN end-to-end test "ovn -- 3 HVs, 1 LS, 3 lports/HV".  The
> differences between the old and the new test illustrate properties of
> tracing.  First, the new test does not start any ovn-controller processes
> or simulate any hypervisors in a nontrivial way.  This is because ovn-trace
> does not actually forward packets or rely on the physical structure of the
> system.  Second, whereas the old test tested not just the logical but also
> the physical structure of the system, it needed to have several logical
> ports, a total of 9 (3 on each of 3 HVs), whereas since this test only
> tests the logical network implementation it can use a smaller number.  This
> property also means that the new test runs signicantly faster than the old
> one (less than a second on my laptop).
> 
> In my opinion this approach points the way toward the future of OVN
> testing.  Certainly, we need end-to-end tests.  However, I believe that the
> bulk of our tests can be broken into ones that test the logical network
> implementation (using tracing) and ones that test physical/logical
> translation.
> 
> Signed-off-by: Ben Pfaff <blp at ovn.org <mailto:blp at ovn.org>>
> ---
> 
> +
> +/* --detailed: Show a detailed, table-by-table trace. */
> +static bool detailed;
> +
> +/* --summary: Show a trace that omits table information. */
> +static bool summary;
> +
> +/* --minimal: Show a trace with only minimal information. */
> +static bool minimal;
> +

As a little reminder, it is better to initialize ‘detailed’, ‘summary’, and ‘minimal' variables with a value of ‘false'.


Thanks,
zhangtonghao.





More information about the dev mailing list